cleanup: Use consistent 4-space indent

This is another bit where we've made good progress, and just need
a final push to complete the transition.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
This commit is contained in:
Florian Müllner 2023-08-07 01:45:22 +02:00 committed by Marge Bot
parent 071f92cfb6
commit 9a3913d4a0
65 changed files with 530 additions and 494 deletions

View File

@ -70,8 +70,9 @@ export const UserListItem = GObject.registerClass({
this._userWidget = new UserWidget.UserWidget(this.user); this._userWidget = new UserWidget.UserWidget(this.user);
layout.add(this._userWidget); layout.add(this._userWidget);
this._userWidget.bind_property('label-actor', this, 'label-actor', this._userWidget.bind_property('label-actor',
GObject.BindingFlags.SYNC_CREATE); this, 'label-actor',
GObject.BindingFlags.SYNC_CREATE);
this._timedLoginIndicator = new St.Bin({ this._timedLoginIndicator = new St.Bin({
style_class: 'login-dialog-timed-login-indicator', style_class: 'login-dialog-timed-login-indicator',
@ -168,8 +169,9 @@ const UserList = GObject.registerClass({
x_expand: true, x_expand: true,
y_expand: true, y_expand: true,
}); });
this.set_policy(St.PolicyType.NEVER, this.set_policy(
St.PolicyType.AUTOMATIC); St.PolicyType.NEVER,
St.PolicyType.AUTOMATIC);
this._box = new St.BoxLayout({ this._box = new St.BoxLayout({
vertical: true, vertical: true,
@ -342,7 +344,7 @@ const SessionMenuButton = GObject.registerClass({
}); });
this._manager = new PopupMenu.PopupMenuManager(this._button, this._manager = new PopupMenu.PopupMenuManager(this._button,
{actionMode: Shell.ActionMode.NONE}); {actionMode: Shell.ActionMode.NONE});
this._manager.addMenu(this._menu); this._manager.addMenu(this._menu);
this._button.connect('clicked', () => this._menu.toggle()); this._button.connect('clicked', () => this._menu.toggle());
@ -432,13 +434,13 @@ export const LoginDialog = GObject.registerClass({
this._settings = new Gio.Settings({schema_id: GdmUtil.LOGIN_SCREEN_SCHEMA}); this._settings = new Gio.Settings({schema_id: GdmUtil.LOGIN_SCREEN_SCHEMA});
this._settings.connect(`changed::${GdmUtil.BANNER_MESSAGE_KEY}`, this._settings.connect(`changed::${GdmUtil.BANNER_MESSAGE_KEY}`,
this._updateBanner.bind(this)); this._updateBanner.bind(this));
this._settings.connect(`changed::${GdmUtil.BANNER_MESSAGE_TEXT_KEY}`, this._settings.connect(`changed::${GdmUtil.BANNER_MESSAGE_TEXT_KEY}`,
this._updateBanner.bind(this)); this._updateBanner.bind(this));
this._settings.connect(`changed::${GdmUtil.DISABLE_USER_LIST_KEY}`, this._settings.connect(`changed::${GdmUtil.DISABLE_USER_LIST_KEY}`,
this._updateDisableUserList.bind(this)); this._updateDisableUserList.bind(this));
this._settings.connect(`changed::${GdmUtil.LOGO_KEY}`, this._settings.connect(`changed::${GdmUtil.LOGO_KEY}`,
this._updateLogo.bind(this)); this._updateLogo.bind(this));
this._textureCache = St.TextureCache.get_default(); this._textureCache = St.TextureCache.get_default();
this._textureCache.connectObject('texture-file-changed', this._textureCache.connectObject('texture-file-changed',
@ -833,11 +835,12 @@ export const LoginDialog = GObject.registerClass({
this._logoBin.destroy_all_children(); this._logoBin.destroy_all_children();
const resourceScale = this._logoBin.get_resource_scale(); const resourceScale = this._logoBin.get_resource_scale();
if (this._logoFile) { if (this._logoFile) {
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; const scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
this._logoBin.add_child(this._textureCache.load_file_async(this._logoFile, const texture = this._textureCache.load_file_async(
-1, -1, this._logoFile,
scaleFactor, -1, -1,
resourceScale)); scaleFactor, resourceScale);
this._logoBin.add_child(texture);
} }
} }
@ -1262,9 +1265,9 @@ export const LoginDialog = GObject.registerClass({
open() { open() {
Main.ctrlAltTabManager.addGroup(this, Main.ctrlAltTabManager.addGroup(this,
_('Login Window'), _('Login Window'),
'dialog-password-symbolic', 'dialog-password-symbolic',
{sortGroup: CtrlAltTab.SortGroup.MIDDLE}); {sortGroup: CtrlAltTab.SortGroup.MIDDLE});
this.activate(); this.activate();
this.opacity = 0; this.opacity = 0;

View File

@ -19,9 +19,9 @@ export class Manager extends Signals.EventEmitter {
super(); super();
this._aggregateProvider = Provider(Gio.DBus.system, this._aggregateProvider = Provider(Gio.DBus.system,
'org.freedesktop.realmd', 'org.freedesktop.realmd',
'/org/freedesktop/realmd', '/org/freedesktop/realmd',
this._reloadRealms.bind(this)); this._reloadRealms.bind(this));
this._realms = {}; this._realms = {};
this._loginFormat = null; this._loginFormat = null;
@ -41,9 +41,9 @@ export class Manager extends Signals.EventEmitter {
for (let i = 0; i < realmPaths.length; i++) { for (let i = 0; i < realmPaths.length; i++) {
Realm(Gio.DBus.system, Realm(Gio.DBus.system,
'org.freedesktop.realmd', 'org.freedesktop.realmd',
realmPaths[i], realmPaths[i],
this._onRealmLoaded.bind(this)); this._onRealmLoaded.bind(this));
} }
} }

View File

@ -109,7 +109,7 @@ export class ShellUserVerifier extends Signals.EventEmitter {
this._settings = new Gio.Settings({schema_id: LOGIN_SCREEN_SCHEMA}); this._settings = new Gio.Settings({schema_id: LOGIN_SCREEN_SCHEMA});
this._settings.connect('changed', this._settings.connect('changed',
this._updateDefaultService.bind(this)); this._updateDefaultService.bind(this));
this._updateDefaultService(); this._updateDefaultService();
this._fprintManager = new FprintManagerProxy(Gio.DBus.system, this._fprintManager = new FprintManagerProxy(Gio.DBus.system,

View File

@ -22,8 +22,10 @@ const PresenceProxy = Gio.DBusProxy.makeProxyWrapper(PresenceIface);
* @returns {Gio.DBusProxy} * @returns {Gio.DBusProxy}
*/ */
export function Presence(initCallback, cancellable) { export function Presence(initCallback, cancellable) {
return new PresenceProxy(Gio.DBus.session, 'org.gnome.SessionManager', return new PresenceProxy(Gio.DBus.session,
'/org/gnome/SessionManager/Presence', initCallback, cancellable); 'org.gnome.SessionManager',
'/org/gnome/SessionManager/Presence',
initCallback, cancellable);
} }
// Note inhibitors are immutable objects, so they don't // Note inhibitors are immutable objects, so they don't

View File

@ -23,7 +23,7 @@ export class HistoryManager extends Signals.EventEmitter {
if (this._key) { if (this._key) {
this._history = global.settings.get_strv(this._key); this._history = global.settings.get_strv(this._key);
global.settings.connect(`changed::${this._key}`, global.settings.connect(`changed::${this._key}`,
this._historyChanged.bind(this)); this._historyChanged.bind(this));
} else { } else {
this._history = []; this._history = [];
} }
@ -32,7 +32,7 @@ export class HistoryManager extends Signals.EventEmitter {
if (this._entry) { if (this._entry) {
this._entry.connect('key-press-event', this._entry.connect('key-press-event',
this._onEntryKeyPress.bind(this)); this._onEntryKeyPress.bind(this));
} }
} }

View File

@ -42,7 +42,7 @@ export const InputMethod = GObject.registerClass({
this._inputSourceManager = Keyboard.getInputSourceManager(); this._inputSourceManager = Keyboard.getInputSourceManager();
this._sourceChangedId = this._inputSourceManager.connect('current-source-changed', this._sourceChangedId = this._inputSourceManager.connect('current-source-changed',
this._onSourceChanged.bind(this)); this._onSourceChanged.bind(this));
this._currentSource = this._inputSourceManager.currentSource; this._currentSource = this._inputSourceManager.currentSource;
if (this._ibus.is_connected()) if (this._ibus.is_connected())

View File

@ -18,12 +18,12 @@ const IntrospectDBusIface = loadInterfaceXML('org.gnome.Shell.Introspect');
export class IntrospectService { export class IntrospectService {
constructor() { constructor() {
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(IntrospectDBusIface, this._dbusImpl =
this); Gio.DBusExportedObject.wrapJSObject(IntrospectDBusIface, this);
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell/Introspect'); this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell/Introspect');
Gio.DBus.session.own_name('org.gnome.Shell.Introspect', Gio.DBus.session.own_name('org.gnome.Shell.Introspect',
Gio.BusNameOwnerFlags.REPLACE, Gio.BusNameOwnerFlags.REPLACE,
null, null); null, null);
this._runningApplications = {}; this._runningApplications = {};
this._runningApplicationsDirty = true; this._runningApplicationsDirty = true;
@ -32,18 +32,16 @@ export class IntrospectService {
this._animationsEnabled = true; this._animationsEnabled = true;
this._appSystem = Shell.AppSystem.get_default(); this._appSystem = Shell.AppSystem.get_default();
this._appSystem.connect('app-state-changed', this._appSystem.connect('app-state-changed', () => {
() => { this._runningApplicationsDirty = true;
this._runningApplicationsDirty = true; this._syncRunningApplications();
this._syncRunningApplications(); });
});
let tracker = Shell.WindowTracker.get_default(); let tracker = Shell.WindowTracker.get_default();
tracker.connect('notify::focus-app', tracker.connect('notify::focus-app', () => {
() => { this._activeApplicationDirty = true;
this._activeApplicationDirty = true; this._syncRunningApplications();
this._syncRunningApplications(); });
});
tracker.connect('tracked-windows-changed', tracker.connect('tracked-windows-changed',
() => this._dbusImpl.emit_signal('WindowsChanged', null)); () => this._dbusImpl.emit_signal('WindowsChanged', null));

View File

@ -38,12 +38,13 @@ function versionCompare(required, reference) {
export function canLock() { export function canLock() {
try { try {
let params = GLib.Variant.new('(ss)', ['org.gnome.DisplayManager.Manager', 'Version']); let params = GLib.Variant.new('(ss)', ['org.gnome.DisplayManager.Manager', 'Version']);
let result = Gio.DBus.system.call_sync('org.gnome.DisplayManager', let result = Gio.DBus.system.call_sync(
'/org/gnome/DisplayManager/Manager', 'org.gnome.DisplayManager',
'org.freedesktop.DBus.Properties', '/org/gnome/DisplayManager/Manager',
'Get', params, null, 'org.freedesktop.DBus.Properties',
Gio.DBusCallFlags.NONE, 'Get', params, null,
-1, null); Gio.DBusCallFlags.NONE,
-1, null);
let version = result.deepUnpack()[0].deepUnpack(); let version = result.deepUnpack()[0].deepUnpack();
return haveSystemd() && versionCompare('3.5.91', version); return haveSystemd() && versionCompare('3.5.91', version);
@ -93,13 +94,13 @@ class LoginManagerSystemd extends Signals.EventEmitter {
super(); super();
this._proxy = new SystemdLoginManager(Gio.DBus.system, this._proxy = new SystemdLoginManager(Gio.DBus.system,
'org.freedesktop.login1', 'org.freedesktop.login1',
'/org/freedesktop/login1'); '/org/freedesktop/login1');
this._userProxy = new SystemdLoginUser(Gio.DBus.system, this._userProxy = new SystemdLoginUser(Gio.DBus.system,
'org.freedesktop.login1', 'org.freedesktop.login1',
'/org/freedesktop/login1/user/self'); '/org/freedesktop/login1/user/self');
this._proxy.connectSignal('PrepareForSleep', this._proxy.connectSignal('PrepareForSleep',
this._prepareForSleep.bind(this)); this._prepareForSleep.bind(this));
} }
async getCurrentSessionProxy() { async getCurrentSessionProxy() {
@ -118,8 +119,8 @@ class LoginManagerSystemd extends Signals.EventEmitter {
for ([session, objectPath] of this._userProxy.Sessions) { for ([session, objectPath] of this._userProxy.Sessions) {
let sessionProxy = new SystemdLoginSession(Gio.DBus.system, let sessionProxy = new SystemdLoginSession(Gio.DBus.system,
'org.freedesktop.login1', 'org.freedesktop.login1',
objectPath); objectPath);
log(`Considering ${session}, class=${sessionProxy.Class}`); log(`Considering ${session}, class=${sessionProxy.Class}`);
if (sessionProxy.Class == 'greeter') { if (sessionProxy.Class == 'greeter') {
log(`Yes, will monitor session ${session}`); log(`Yes, will monitor session ${session}`);

View File

@ -14,7 +14,7 @@ const PermissionStoreProxy = Gio.DBusProxy.makeProxyWrapper(PermissionStoreIface
*/ */
export function PermissionStore(initCallback, cancellable) { export function PermissionStore(initCallback, cancellable) {
return new PermissionStoreProxy(Gio.DBus.session, return new PermissionStoreProxy(Gio.DBus.session,
'org.freedesktop.impl.portal.PermissionStore', 'org.freedesktop.impl.portal.PermissionStore',
'/org/freedesktop/impl/portal/PermissionStore', '/org/freedesktop/impl/portal/PermissionStore',
initCallback, cancellable); initCallback, cancellable);
} }

View File

@ -161,26 +161,26 @@ const SystemActions = GObject.registerClass({
this._userManager = AccountsService.UserManager.get_default(); this._userManager = AccountsService.UserManager.get_default();
this._userManager.connect('notify::is-loaded', this._userManager.connect('notify::is-loaded',
() => this._updateMultiUser()); () => this._updateMultiUser());
this._userManager.connect('notify::has-multiple-users', this._userManager.connect('notify::has-multiple-users',
() => this._updateMultiUser()); () => this._updateMultiUser());
this._userManager.connect('user-added', this._userManager.connect('user-added',
() => this._updateMultiUser()); () => this._updateMultiUser());
this._userManager.connect('user-removed', this._userManager.connect('user-removed',
() => this._updateMultiUser()); () => this._updateMultiUser());
this._lockdownSettings.connect(`changed::${DISABLE_USER_SWITCH_KEY}`, this._lockdownSettings.connect(`changed::${DISABLE_USER_SWITCH_KEY}`,
() => this._updateSwitchUser()); () => this._updateSwitchUser());
this._lockdownSettings.connect(`changed::${DISABLE_LOG_OUT_KEY}`, this._lockdownSettings.connect(`changed::${DISABLE_LOG_OUT_KEY}`,
() => this._updateLogout()); () => this._updateLogout());
global.settings.connect(`changed::${ALWAYS_SHOW_LOG_OUT_KEY}`, global.settings.connect(`changed::${ALWAYS_SHOW_LOG_OUT_KEY}`,
() => this._updateLogout()); () => this._updateLogout());
this._lockdownSettings.connect(`changed::${DISABLE_LOCK_SCREEN_KEY}`, this._lockdownSettings.connect(`changed::${DISABLE_LOCK_SCREEN_KEY}`,
() => this._updateLockScreen()); () => this._updateLockScreen());
this._lockdownSettings.connect(`changed::${DISABLE_LOG_OUT_KEY}`, this._lockdownSettings.connect(`changed::${DISABLE_LOG_OUT_KEY}`,
() => this._updateHaveShutdown()); () => this._updateHaveShutdown());
this.forceUpdate(); this.forceUpdate();
@ -189,7 +189,7 @@ const SystemActions = GObject.registerClass({
this._updateOrientationLockStatus(); this._updateOrientationLockStatus();
}); });
Main.layoutManager.connect('monitors-changed', Main.layoutManager.connect('monitors-changed',
() => this._updateOrientationLock()); () => this._updateOrientationLock());
this._monitorManager.connect('notify::panel-orientation-managed', this._monitorManager.connect('notify::panel-orientation-managed',
() => this._updateOrientationLock()); () => this._updateOrientationLock());
this._updateOrientationLock(); this._updateOrientationLock();

View File

@ -98,8 +98,9 @@ export function spawnCommandLine(commandLine) {
*/ */
export function spawnApp(argv) { export function spawnApp(argv) {
try { try {
let app = Gio.AppInfo.create_from_commandline(argv.join(' '), null, const app = Gio.AppInfo.create_from_commandline(argv.join(' '),
Gio.AppInfoCreateFlags.SUPPORTS_STARTUP_NOTIFICATION); null,
Gio.AppInfoCreateFlags.SUPPORTS_STARTUP_NOTIFICATION);
let context = global.create_app_launch_context(0, -1); let context = global.create_app_launch_context(0, -1);
app.launch([], context); app.launch([], context);

View File

@ -67,11 +67,11 @@ export class WeatherClient extends Signals.EventEmitter {
this._onPermStoreChanged(this._permStore, '', params); this._onPermStoreChanged(this._permStore, '', params);
}); });
this._permStore.connectSignal('Changed', this._permStore.connectSignal('Changed',
this._onPermStoreChanged.bind(this)); this._onPermStoreChanged.bind(this));
this._locationSettings = new Gio.Settings({schema_id: 'org.gnome.system.location'}); this._locationSettings = new Gio.Settings({schema_id: 'org.gnome.system.location'});
this._locationSettings.connect('changed::enabled', this._locationSettings.connect('changed::enabled',
this._updateAutoLocation.bind(this)); this._updateAutoLocation.bind(this));
this._world = GWeather.Location.get_world(); this._world = GWeather.Location.get_world();
@ -240,7 +240,7 @@ export class WeatherClient extends Signals.EventEmitter {
this._gclueLocationChangedId = this._gclueLocationChangedId =
this._gclueService.connect('notify::location', this._gclueService.connect('notify::location',
this._onGClueLocationChanged.bind(this)); this._onGClueLocationChanged.bind(this));
this._onGClueLocationChanged(); this._onGClueLocationChanged();
} else { } else {
if (this._gclueLocationChangedId) if (this._gclueLocationChangedId)
@ -270,10 +270,11 @@ export class WeatherClient extends Signals.EventEmitter {
_onGClueLocationChanged() { _onGClueLocationChanged() {
let geoLocation = this._gclueService.location; let geoLocation = this._gclueService.location;
let location = GWeather.Location.new_detached(geoLocation.description, let location = GWeather.Location.new_detached(
null, geoLocation.description,
geoLocation.latitude, null,
geoLocation.longitude); geoLocation.latitude,
geoLocation.longitude);
this._setLocation(location); this._setLocation(location);
} }

View File

@ -96,9 +96,10 @@ class AccessDialog extends ModalDialog.ModalDialog {
CloseAsync(invocation, _params) { CloseAsync(invocation, _params) {
if (this._invocation.get_sender() != invocation.get_sender()) { if (this._invocation.get_sender() != invocation.get_sender()) {
invocation.return_error_literal(Gio.DBusError, invocation.return_error_literal(
Gio.DBusError.ACCESS_DENIED, Gio.DBusError,
''); Gio.DBusError.ACCESS_DENIED,
'');
return; return;
} }
@ -120,8 +121,8 @@ class AccessDialog extends ModalDialog.ModalDialog {
// Delay actual response until the end of the close animation (if any) // Delay actual response until the end of the close animation (if any)
this.connect('closed', () => { this.connect('closed', () => {
this._invocation.return_value(new GLib.Variant('(ua{sv})', this._invocation.return_value(
[response, results])); new GLib.Variant('(ua{sv})', [response, results]));
}); });
this.close(); this.close();
} }
@ -141,9 +142,10 @@ export class AccessDialogDBus {
AccessDialogAsync(params, invocation) { AccessDialogAsync(params, invocation) {
if (this._accessDialog) { if (this._accessDialog) {
invocation.return_error_literal(Gio.DBusError, invocation.return_error_literal(
Gio.DBusError.LIMITS_EXCEEDED, Gio.DBusError,
'Already showing a system access dialog'); Gio.DBusError.LIMITS_EXCEEDED,
'Already showing a system access dialog');
return; return;
} }
@ -151,9 +153,10 @@ export class AccessDialogDBus {
// We probably want to use parentWindow and global.display.focus_window // We probably want to use parentWindow and global.display.focus_window
// for this check in the future // for this check in the future
if (appId && `${appId}.desktop` !== this._windowTracker.focus_app.id) { if (appId && `${appId}.desktop` !== this._windowTracker.focus_app.id) {
invocation.return_error_literal(Gio.DBusError, invocation.return_error_literal(
Gio.DBusError.ACCESS_DENIED, Gio.DBusError,
'Only the focused app is allowed to show a system access dialog'); Gio.DBusError.ACCESS_DENIED,
'Only the focused app is allowed to show a system access dialog');
return; return;
} }

View File

@ -142,16 +142,18 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
// We actually want the second window if we're in the unset state // We actually want the second window if we're in the unset state
if (this._currentWindow == -1) if (this._currentWindow == -1)
this._currentWindow = 0; this._currentWindow = 0;
return SwitcherPopup.mod(this._currentWindow + 1, return SwitcherPopup.mod(
this._items[this._selectedIndex].cachedWindows.length); this._currentWindow + 1,
this._items[this._selectedIndex].cachedWindows.length);
} }
_previousWindow() { _previousWindow() {
// Also assume second window here // Also assume second window here
if (this._currentWindow == -1) if (this._currentWindow == -1)
this._currentWindow = 1; this._currentWindow = 1;
return SwitcherPopup.mod(this._currentWindow - 1, return SwitcherPopup.mod(
this._items[this._selectedIndex].cachedWindows.length); this._currentWindow - 1,
this._items[this._selectedIndex].cachedWindows.length);
} }
_closeAppWindow(appIndex, windowIndex) { _closeAppWindow(appIndex, windowIndex) {
@ -1032,8 +1034,8 @@ class WindowIcon extends St.BoxLayout {
this._icon.add_actor(_createWindowClone(mutterWindow, size * scaleFactor)); this._icon.add_actor(_createWindowClone(mutterWindow, size * scaleFactor));
if (this.app) { if (this.app) {
this._icon.add_actor(this._createAppIcon(this.app, this._icon.add_actor(
APP_ICON_SIZE_SMALL)); this._createAppIcon(this.app, APP_ICON_SIZE_SMALL));
} }
break; break;

View File

@ -168,11 +168,12 @@ export class AudioDeviceSelectionDBus {
let info = this._dbusImpl.get_info(); let info = this._dbusImpl.get_info();
const deviceName = Object.keys(AudioDevice) const deviceName = Object.keys(AudioDevice)
.filter(dev => AudioDevice[dev] === device)[0].toLowerCase(); .filter(dev => AudioDevice[dev] === device)[0].toLowerCase();
connection.emit_signal(this._audioSelectionDialog._sender, connection.emit_signal(
this._dbusImpl.get_object_path(), this._audioSelectionDialog._sender,
info ? info.name : null, this._dbusImpl.get_object_path(),
'DeviceSelected', info ? info.name : null,
GLib.Variant.new('(s)', [deviceName])); 'DeviceSelected',
GLib.Variant.new('(s)', [deviceName]));
} }
OpenAsync(params, invocation) { OpenAsync(params, invocation) {
@ -196,7 +197,7 @@ export class AudioDeviceSelectionDBus {
dialog.connect('closed', this._onDialogClosed.bind(this)); dialog.connect('closed', this._onDialogClosed.bind(this));
dialog.connect('device-selected', dialog.connect('device-selected',
this._onDeviceSelected.bind(this)); this._onDeviceSelected.bind(this));
dialog.open(); dialog.open();
this._audioSelectionDialog = dialog; this._audioSelectionDialog = dialog;

View File

@ -157,13 +157,13 @@ class BackgroundCache extends Signals.EventEmitter {
let monitor = file.monitor(Gio.FileMonitorFlags.NONE, null); let monitor = file.monitor(Gio.FileMonitorFlags.NONE, null);
monitor.connect('changed', monitor.connect('changed',
(obj, theFile, otherFile, eventType) => { (obj, theFile, otherFile, eventType) => {
// Ignore CHANGED and CREATED events, since in both cases // Ignore CHANGED and CREATED events, since in both cases
// we'll get a CHANGES_DONE_HINT event when done. // we'll get a CHANGES_DONE_HINT event when done.
if (eventType != Gio.FileMonitorEvent.CHANGED && if (eventType != Gio.FileMonitorEvent.CHANGED &&
eventType != Gio.FileMonitorEvent.CREATED) eventType != Gio.FileMonitorEvent.CREATED)
this.emit('file-changed', file); this.emit('file-changed', file);
}); });
this._fileMonitors[key] = monitor; this._fileMonitors[key] = monitor;
} }
@ -374,13 +374,13 @@ const Background = GObject.registerClass({
this._cache.monitorFile(file); this._cache.monitorFile(file);
let signalId = this._cache.connect('file-changed', let signalId = this._cache.connect('file-changed',
(cache, changedFile) => { (cache, changedFile) => {
if (changedFile.equal(file)) { if (changedFile.equal(file)) {
let imageCache = Meta.BackgroundImageCache.get_default(); let imageCache = Meta.BackgroundImageCache.get_default();
imageCache.purge(changedFile); imageCache.purge(changedFile);
this._emitChangedSignal(); this._emitChangedSignal();
} }
}); });
this._fileWatches[key] = signalId; this._fileWatches[key] = signalId;
} }
@ -401,8 +401,8 @@ const Background = GObject.registerClass({
this._setLoaded(); this._setLoaded();
if (files.length > 1) { if (files.length > 1) {
this.set_blend(files[0], files[1], this.set_blend(files[0], files[1],
this._animation.transitionProgress, this._animation.transitionProgress,
this._style); this._style);
} else if (files.length > 0) { } else if (files.length > 0) {
this.set_file(files[0], this._style); this.set_file(files[0], this._style);
} else { } else {
@ -445,19 +445,20 @@ const Background = GObject.registerClass({
let nSteps = 255 / ANIMATION_OPACITY_STEP_INCREMENT; let nSteps = 255 / ANIMATION_OPACITY_STEP_INCREMENT;
let timePerStep = (this._animation.transitionDuration * 1000) / nSteps; let timePerStep = (this._animation.transitionDuration * 1000) / nSteps;
let interval = Math.max(ANIMATION_MIN_WAKEUP_INTERVAL * 1000, let interval = Math.max(
timePerStep); ANIMATION_MIN_WAKEUP_INTERVAL * 1000,
timePerStep);
if (interval > GLib.MAXUINT32) if (interval > GLib.MAXUINT32)
return; return;
this._updateAnimationTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, this._updateAnimationTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
interval, interval,
() => { () => {
this._updateAnimationTimeoutId = 0; this._updateAnimationTimeoutId = 0;
this._updateAnimation(); this._updateAnimation();
return GLib.SOURCE_REMOVE; return GLib.SOURCE_REMOVE;
}); });
GLib.Source.set_name_by_id(this._updateAnimationTimeoutId, '[gnome-shell] this._updateAnimation'); GLib.Source.set_name_by_id(this._updateAnimationTimeoutId, '[gnome-shell] this._updateAnimation');
} }
@ -565,7 +566,7 @@ class BackgroundSource {
const monitorManager = global.backend.get_monitor_manager(); const monitorManager = global.backend.get_monitor_manager();
this._monitorsChangedId = this._monitorsChangedId =
monitorManager.connect('monitors-changed', monitorManager.connect('monitors-changed',
this._onMonitorsChanged.bind(this)); this._onMonitorsChanged.bind(this));
this._interfaceSettings = new Gio.Settings({schema_id: INTERFACE_SCHEMA}); this._interfaceSettings = new Gio.Settings({schema_id: INTERFACE_SCHEMA});
} }

View File

@ -348,8 +348,9 @@ export const BoxPointer = GObject.registerClass({
if (!skipTopRight) { if (!skipTopRight) {
cr.lineTo(x2 - borderRadius, y1); cr.lineTo(x2 - borderRadius, y1);
cr.arc(x2 - borderRadius, y1 + borderRadius, borderRadius, cr.arc(
3 * Math.PI / 2, Math.PI * 2); x2 - borderRadius, y1 + borderRadius, borderRadius,
3 * Math.PI / 2, Math.PI * 2);
} }
if (this._arrowSide == St.Side.RIGHT && rise) { if (this._arrowSide == St.Side.RIGHT && rise) {
@ -369,8 +370,9 @@ export const BoxPointer = GObject.registerClass({
if (!skipBottomRight) { if (!skipBottomRight) {
cr.lineTo(x2, y2 - borderRadius); cr.lineTo(x2, y2 - borderRadius);
cr.arc(x2 - borderRadius, y2 - borderRadius, borderRadius, cr.arc(
0, Math.PI / 2); x2 - borderRadius, y2 - borderRadius, borderRadius,
0, Math.PI / 2);
} }
if (this._arrowSide == St.Side.BOTTOM && rise) { if (this._arrowSide == St.Side.BOTTOM && rise) {
@ -390,8 +392,9 @@ export const BoxPointer = GObject.registerClass({
if (!skipBottomLeft) { if (!skipBottomLeft) {
cr.lineTo(x1 + borderRadius, y2); cr.lineTo(x1 + borderRadius, y2);
cr.arc(x1 + borderRadius, y2 - borderRadius, borderRadius, cr.arc(
Math.PI / 2, Math.PI); x1 + borderRadius, y2 - borderRadius, borderRadius,
Math.PI / 2, Math.PI);
} }
if (this._arrowSide == St.Side.LEFT && rise) { if (this._arrowSide == St.Side.LEFT && rise) {
@ -411,8 +414,9 @@ export const BoxPointer = GObject.registerClass({
if (!skipTopLeft) { if (!skipTopLeft) {
cr.lineTo(x1, y1 + borderRadius); cr.lineTo(x1, y1 + borderRadius);
cr.arc(x1 + borderRadius, y1 + borderRadius, borderRadius, cr.arc(
Math.PI, 3 * Math.PI / 2); x1 + borderRadius, y1 + borderRadius, borderRadius,
Math.PI, 3 * Math.PI / 2);
} }
const [hasColor, bgColor] = const [hasColor, bgColor] =

View File

@ -131,7 +131,7 @@ export const CloseDialog = GObject.registerClass({
if (shouldTrack) { if (shouldTrack) {
Main.layoutManager.trackChrome(this._dialog, Main.layoutManager.trackChrome(this._dialog,
{affectsInputRegion: true}); {affectsInputRegion: true});
} else { } else {
Main.layoutManager.untrackChrome(this._dialog); Main.layoutManager.untrackChrome(this._dialog);
} }

View File

@ -22,9 +22,9 @@ class AutomountManager {
this._activeOperations = new Map(); this._activeOperations = new Map();
this._session = new GnomeSession.SessionManager(); this._session = new GnomeSession.SessionManager();
this._session.connectSignal('InhibitorAdded', this._session.connectSignal('InhibitorAdded',
this._InhibitorsChanged.bind(this)); this._InhibitorsChanged.bind(this));
this._session.connectSignal('InhibitorRemoved', this._session.connectSignal('InhibitorRemoved',
this._InhibitorsChanged.bind(this)); this._InhibitorsChanged.bind(this));
this._inhibited = false; this._inhibited = false;
this._volumeMonitor = Gio.VolumeMonitor.get(); this._volumeMonitor = Gio.VolumeMonitor.get();
@ -81,8 +81,8 @@ class AutomountManager {
let player = global.display.get_sound_player(); let player = global.display.get_sound_player();
player.play_from_theme('device-added-media', player.play_from_theme('device-added-media',
_('External drive connected'), _('External drive connected'),
null); null);
} }
_onDriveDisconnected() { _onDriveDisconnected() {
@ -93,8 +93,8 @@ class AutomountManager {
let player = global.display.get_sound_player(); let player = global.display.get_sound_player();
player.play_from_theme('device-removed-media', player.play_from_theme('device-removed-media',
_('External drive disconnected'), _('External drive disconnected'),
null); null);
} }
_onDriveEjectButton(monitor, drive) { _onDriveEjectButton(monitor, drive) {
@ -180,7 +180,7 @@ class AutomountManager {
this._activeOperations.set(volume, operation); this._activeOperations.set(volume, operation);
volume.mount(0, mountOp, null, volume.mount(0, mountOp, null,
this._onVolumeMounted.bind(this)); this._onVolumeMounted.bind(this));
} }
_onVolumeMounted(volume, res) { _onVolumeMounted(volume, res) {
@ -226,8 +226,7 @@ class AutomountManager {
let prevOperation = this._activeOperations.get(volume); let prevOperation = this._activeOperations.get(volume);
const existingDialog = prevOperation?.borrowDialog(); const existingDialog = prevOperation?.borrowDialog();
let operation = let operation =
new ShellMountOperation.ShellMountOperation(volume, new ShellMountOperation.ShellMountOperation(volume, {existingDialog});
{existingDialog});
this._mountVolume(volume, operation); this._mountVolume(volume, operation);
} }

View File

@ -69,7 +69,7 @@ function startAppForMount(app, mount) {
try { try {
retval = app.launch(files, retval = app.launch(files,
global.create_app_launch_context(0, -1)); global.create_app_launch_context(0, -1));
} catch (e) { } catch (e) {
log(`Unable to launch the app ${app.get_name()}: ${e}`); log(`Unable to launch the app ${app.get_name()}: ${e}`);
} }
@ -81,8 +81,8 @@ const HotplugSnifferIface = loadInterfaceXML('org.gnome.Shell.HotplugSniffer');
const HotplugSnifferProxy = Gio.DBusProxy.makeProxyWrapper(HotplugSnifferIface); const HotplugSnifferProxy = Gio.DBusProxy.makeProxyWrapper(HotplugSnifferIface);
function HotplugSniffer() { function HotplugSniffer() {
return new HotplugSnifferProxy(Gio.DBus.session, return new HotplugSnifferProxy(Gio.DBus.session,
'org.gnome.Shell.HotplugSniffer', 'org.gnome.Shell.HotplugSniffer',
'/org/gnome/Shell/HotplugSniffer'); '/org/gnome/Shell/HotplugSniffer');
} }
class ContentTypeDiscoverer { class ContentTypeDiscoverer {

View File

@ -216,7 +216,7 @@ class KeyringPrompter extends Gcr.SystemPrompter {
if (!this._registered) { if (!this._registered) {
this.register(Gio.DBus.session); this.register(Gio.DBus.session);
this._dbusId = Gio.DBus.session.own_name('org.gnome.keyring.SystemPrompter', this._dbusId = Gio.DBus.session.own_name('org.gnome.keyring.SystemPrompter',
Gio.BusNameOwnerFlags.ALLOW_REPLACEMENT, null, null); Gio.BusNameOwnerFlags.ALLOW_REPLACEMENT, null, null);
this._registered = true; this._registered = true;
} }
this._enabled = true; this._enabled = true;

View File

@ -480,7 +480,7 @@ class VPNRequestHandler extends Signals.EventEmitter {
this._readStdoutOldStyle(); this._readStdoutOldStyle();
this._childWatch = GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid, this._childWatch = GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid,
this._vpnChildFinished.bind(this)); this._vpnChildFinished.bind(this));
this._writeConnection(); this._writeConnection();
} catch (e) { } catch (e) {

View File

@ -425,9 +425,10 @@ class ChatSource extends MessageTray.Source {
_updateAvatarIcon() { _updateAvatarIcon() {
this.iconUpdated(); this.iconUpdated();
if (this._notification) { if (this._notification) {
this._notification.update(this._notification.title, this._notification.update(
this._notification.bannerBodyText, this._notification.title,
{gicon: this.getIcon()}); this._notification.bannerBodyText,
{gicon: this.getIcon()});
} }
} }
@ -631,9 +632,10 @@ class ChatSource extends MessageTray.Source {
_presenceChanged(_contact, _presence, _status, _message) { _presenceChanged(_contact, _presence, _status, _message) {
if (this._notification) { if (this._notification) {
this._notification.update(this._notification.title, this._notification.update(
this._notification.bannerBodyText, this._notification.title,
{secondaryGIcon: this.getSecondaryIcon()}); this._notification.bannerBodyText,
{secondaryGIcon: this.getSecondaryIcon()});
} }
} }

View File

@ -88,7 +88,7 @@ export class CtrlAltTabManager {
let workspaceManager = global.workspace_manager; let workspaceManager = global.workspace_manager;
let activeWorkspace = workspaceManager.get_active_workspace(); let activeWorkspace = workspaceManager.get_active_workspace();
let windows = display.get_tab_list(Meta.TabList.DOCKS, let windows = display.get_tab_list(Meta.TabList.DOCKS,
activeWorkspace); activeWorkspace);
let windowTracker = Shell.WindowTracker.get_default(); let windowTracker = Shell.WindowTracker.get_default();
let textureCache = St.TextureCache.get_default(); let textureCache = St.TextureCache.get_default();
for (let i = 0; i < windows.length; i++) { for (let i = 0; i < windows.length; i++) {
@ -130,10 +130,9 @@ export class CtrlAltTabManager {
this._popup = new CtrlAltTabPopup(items); this._popup = new CtrlAltTabPopup(items);
this._popup.show(backward, binding, mask); this._popup.show(backward, binding, mask);
this._popup.connect('destroy', this._popup.connect('destroy', () => {
() => { this._popup = null;
this._popup = null; });
});
} }
} }

View File

@ -99,16 +99,18 @@ class DashItemContainer extends St.Widget {
let themeNode = this.get_theme_node(); let themeNode = this.get_theme_node();
forWidth = themeNode.adjust_for_width(forWidth); forWidth = themeNode.adjust_for_width(forWidth);
let [minHeight, natHeight] = super.vfunc_get_preferred_height(forWidth); let [minHeight, natHeight] = super.vfunc_get_preferred_height(forWidth);
return themeNode.adjust_preferred_height(minHeight * this.scale_y, return themeNode.adjust_preferred_height(
natHeight * this.scale_y); minHeight * this.scale_y,
natHeight * this.scale_y);
} }
vfunc_get_preferred_width(forHeight) { vfunc_get_preferred_width(forHeight) {
let themeNode = this.get_theme_node(); let themeNode = this.get_theme_node();
forHeight = themeNode.adjust_for_height(forHeight); forHeight = themeNode.adjust_for_height(forHeight);
let [minWidth, natWidth] = super.vfunc_get_preferred_width(forHeight); let [minWidth, natWidth] = super.vfunc_get_preferred_width(forHeight);
return themeNode.adjust_preferred_width(minWidth * this.scale_x, return themeNode.adjust_preferred_width(
natWidth * this.scale_x); minWidth * this.scale_x,
natWidth * this.scale_x);
} }
showLabel() { showLabel() {
@ -512,10 +514,9 @@ export const Dash = GObject.registerClass({
_createAppItem(app) { _createAppItem(app) {
let appIcon = new DashIcon(app); let appIcon = new DashIcon(app);
appIcon.connect('menu-state-changed', appIcon.connect('menu-state-changed', (o, opened) => {
(o, opened) => { this._itemMenuStateChanged(item, opened);
this._itemMenuStateChanged(item, opened); });
});
let item = new DashItemContainer(); let item = new DashItemContainer();
item.setChild(appIcon); item.setChild(appIcon);
@ -663,8 +664,9 @@ export const Dash = GObject.registerClass({
// Scale the icon's texture to the previous size and // Scale the icon's texture to the previous size and
// tween to the new size // tween to the new size
icon.icon.set_size(icon.icon.width * scale, icon.icon.set_size(
icon.icon.height * scale); icon.icon.width * scale,
icon.icon.height * scale);
icon.icon.ease({ icon.icon.ease({
width: targetWidth, width: targetWidth,
@ -782,8 +784,9 @@ export const Dash = GObject.registerClass({
} }
for (let i = 0; i < addedItems.length; i++) { for (let i = 0; i < addedItems.length; i++) {
this._box.insert_child_at_index(addedItems[i].item, this._box.insert_child_at_index(
addedItems[i].pos); addedItems[i].item,
addedItems[i].pos);
} }
for (let i = 0; i < removedActors.length; i++) { for (let i = 0; i < removedActors.length; i++) {
@ -925,8 +928,9 @@ export const Dash = GObject.registerClass({
this._dragPlaceholder = new DragPlaceholderItem(); this._dragPlaceholder = new DragPlaceholderItem();
this._dragPlaceholder.child.set_width(this.iconSize); this._dragPlaceholder.child.set_width(this.iconSize);
this._dragPlaceholder.child.set_height(this.iconSize / 2); this._dragPlaceholder.child.set_height(this.iconSize / 2);
this._box.insert_child_at_index(this._dragPlaceholder, this._box.insert_child_at_index(
this._dragPlaceholderPos); this._dragPlaceholder,
this._dragPlaceholderPos);
this._dragPlaceholder.show(fadeIn); this._dragPlaceholder.show(fadeIn);
} }

View File

@ -238,7 +238,7 @@ class _Draggable extends Signals.EventEmitter {
_grabActor(device, touchSequence) { _grabActor(device, touchSequence) {
this._grabDevice(this.actor, device, touchSequence); this._grabDevice(this.actor, device, touchSequence);
this._onEventId = this.actor.connect('event', this._onEventId = this.actor.connect('event',
this._onEvent.bind(this)); this._onEvent.bind(this));
} }
_ungrabActor() { _ungrabActor() {
@ -573,8 +573,8 @@ class _Draggable extends Signals.EventEmitter {
} }
_pickTargetActor() { _pickTargetActor() {
return this._dragActor.get_stage().get_actor_at_pos(Clutter.PickMode.ALL, return this._dragActor.get_stage().get_actor_at_pos(
this._dragX, this._dragY); Clutter.PickMode.ALL, this._dragX, this._dragY);
} }
_updateDragHover() { _updateDragHover() {
@ -619,11 +619,12 @@ class _Draggable extends Signals.EventEmitter {
// We currently loop through all parents on drag-over even if one of the children has handled it. // We currently loop through all parents on drag-over even if one of the children has handled it.
// We can check the return value of the function and break the loop if it's true if we don't want // We can check the return value of the function and break the loop if it's true if we don't want
// to continue checking the parents. // to continue checking the parents.
let result = target._delegate.handleDragOver(this.actor._delegate, let result = target._delegate.handleDragOver(
this._dragActor, this.actor._delegate,
targX, this._dragActor,
targY, targX,
0); targY,
0);
if (result != DragMotionResult.CONTINUE) { if (result != DragMotionResult.CONTINUE) {
global.display.set_cursor(DRAG_CURSOR_MAP[result]); global.display.set_cursor(DRAG_CURSOR_MAP[result]);
return GLib.SOURCE_REMOVE; return GLib.SOURCE_REMOVE;
@ -640,7 +641,7 @@ class _Draggable extends Signals.EventEmitter {
return; return;
this._updateHoverId = GLib.idle_add(GLib.PRIORITY_DEFAULT, this._updateHoverId = GLib.idle_add(GLib.PRIORITY_DEFAULT,
this._updateDragHover.bind(this)); this._updateDragHover.bind(this));
GLib.Source.set_name_by_id(this._updateHoverId, '[gnome-shell] this._updateDragHover'); GLib.Source.set_name_by_id(this._updateHoverId, '[gnome-shell] this._updateDragHover');
} }
@ -648,8 +649,9 @@ class _Draggable extends Signals.EventEmitter {
let [stageX, stageY] = event.get_coords(); let [stageX, stageY] = event.get_coords();
this._dragX = stageX; this._dragX = stageX;
this._dragY = stageY; this._dragY = stageY;
this._dragActor.set_position(stageX + this._dragOffsetX, this._dragActor.set_position(
stageY + this._dragOffsetY); stageX + this._dragOffsetX,
stageY + this._dragOffsetY);
this._queueUpdateDragHover(); this._queueUpdateDragHover();
return true; return true;
@ -657,8 +659,8 @@ class _Draggable extends Signals.EventEmitter {
_dragActorDropped(event) { _dragActorDropped(event) {
let [dropX, dropY] = event.get_coords(); let [dropX, dropY] = event.get_coords();
let target = this._dragActor.get_stage().get_actor_at_pos(Clutter.PickMode.ALL, let target = this._dragActor.get_stage().get_actor_at_pos(
dropX, dropY); Clutter.PickMode.ALL, dropX, dropY);
// We call observers only once per motion with the innermost // We call observers only once per motion with the innermost
// target actor. If necessary, the observer can walk the // target actor. If necessary, the observer can walk the

View File

@ -247,22 +247,22 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._updatesPermission = null; this._updatesPermission = null;
this._pkOfflineProxy = new PkOfflineProxy(Gio.DBus.system, this._pkOfflineProxy = new PkOfflineProxy(Gio.DBus.system,
'org.freedesktop.PackageKit', 'org.freedesktop.PackageKit',
'/org/freedesktop/PackageKit', '/org/freedesktop/PackageKit',
this._onPkOfflineProxyCreated.bind(this)); this._onPkOfflineProxyCreated.bind(this));
this._powerProxy = new UPowerProxy(Gio.DBus.system, this._powerProxy = new UPowerProxy(Gio.DBus.system,
'org.freedesktop.UPower', 'org.freedesktop.UPower',
'/org/freedesktop/UPower/devices/DisplayDevice', '/org/freedesktop/UPower/devices/DisplayDevice',
(proxy, error) => { (proxy, error) => {
if (error) { if (error) {
log(error.message); log(error.message);
return; return;
} }
this._powerProxy.connect('g-properties-changed', this._powerProxy.connect('g-properties-changed',
this._sync.bind(this)); this._sync.bind(this));
this._sync(); this._sync();
}); });
this._secondsLeft = 0; this._secondsLeft = 0;
this._totalSecondsToStayOpen = 0; this._totalSecondsToStayOpen = 0;
@ -272,8 +272,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._rebootButton = null; this._rebootButton = null;
this._rebootButtonAlt = null; this._rebootButtonAlt = null;
this.connect('opened', this.connect('opened', this._onOpened.bind(this));
this._onOpened.bind(this));
this._user.connectObject( this._user.connectObject(
'notify::is-loaded', this._sync.bind(this), 'notify::is-loaded', this._sync.bind(this),
@ -379,9 +378,8 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._batteryWarning.visible = this._shouldShowLowBatteryWarning(dialogContent); this._batteryWarning.visible = this._shouldShowLowBatteryWarning(dialogContent);
let description; let description;
let displayTime = _roundSecondsToInterval(this._totalSecondsToStayOpen, let displayTime = _roundSecondsToInterval(
this._secondsLeft, this._totalSecondsToStayOpen, this._secondsLeft, 10);
10);
if (this._user.is_loaded) { if (this._user.is_loaded) {
let realName = this._user.get_real_name(); let realName = this._user.get_real_name();
@ -748,8 +746,9 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._sessionSection.list.destroy_all_children(); this._sessionSection.list.destroy_all_children();
if (!(this._type in DialogContent)) { if (!(this._type in DialogContent)) {
invocation.return_dbus_error('org.gnome.Shell.ModalDialog.TypeError', invocation.return_dbus_error(
'Unknown dialog type requested'); 'org.gnome.Shell.ModalDialog.TypeError',
'Unknown dialog type requested');
return; return;
} }
@ -781,8 +780,9 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._updateButtons(); this._updateButtons();
if (!this.open(timestamp)) { if (!this.open(timestamp)) {
invocation.return_dbus_error('org.gnome.Shell.ModalDialog.GrabError', invocation.return_dbus_error(
'Cannot grab pointer and keyboard'); 'org.gnome.Shell.ModalDialog.GrabError',
'Cannot grab pointer and keyboard');
return; return;
} }

View File

@ -227,10 +227,8 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer {
this._preeditText.text = text.get_text(); this._preeditText.text = text.get_text();
let attrs = text.get_attributes(); let attrs = text.get_attributes();
if (attrs) { if (attrs)
this._setTextAttributes(this._preeditText.clutter_text, this._setTextAttributes(this._preeditText.clutter_text, attrs);
attrs);
}
}); });
panelService.connect('show-preedit-text', () => { panelService.connect('show-preedit-text', () => {
this._preeditText.show(); this._preeditText.show();
@ -285,9 +283,9 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer {
} }
this._candidateArea.setCandidates(indexes, this._candidateArea.setCandidates(indexes,
candidates, candidates,
cursorPos % pageSize, cursorPos % pageSize,
lookupTable.is_cursor_visible()); lookupTable.is_cursor_visible());
this._candidateArea.setOrientation(lookupTable.get_orientation()); this._candidateArea.setOrientation(lookupTable.get_orientation());
this._candidateArea.updateButtons(lookupTable.is_round(), page, nPages); this._candidateArea.updateButtons(lookupTable.is_round(), page, nPages);
}); });

View File

@ -19,7 +19,7 @@ class KbdA11yDialog extends GObject.Object {
let seat = Clutter.get_default_backend().get_default_seat(); let seat = Clutter.get_default_backend().get_default_seat();
seat.connect('kbd-a11y-flags-changed', seat.connect('kbd-a11y-flags-changed',
this._showKbdA11yDialog.bind(this)); this._showKbdA11yDialog.bind(this));
} }
_showKbdA11yDialog(seat, newFlags, whatChanged) { _showKbdA11yDialog(seat, newFlags, whatChanged) {

View File

@ -2270,11 +2270,11 @@ class KeyboardController extends Signals.EventEmitter {
keyvalPress(keyval) { keyvalPress(keyval) {
this._virtualDevice.notify_keyval(Clutter.get_current_event_time() * 1000, this._virtualDevice.notify_keyval(Clutter.get_current_event_time() * 1000,
keyval, Clutter.KeyState.PRESSED); keyval, Clutter.KeyState.PRESSED);
} }
keyvalRelease(keyval) { keyvalRelease(keyval) {
this._virtualDevice.notify_keyval(Clutter.get_current_event_time() * 1000, this._virtualDevice.notify_keyval(Clutter.get_current_event_time() * 1000,
keyval, Clutter.KeyState.RELEASED); keyval, Clutter.KeyState.RELEASED);
} }
} }

View File

@ -39,18 +39,18 @@ function isPopupMetaWindow(actor) {
export const MonitorConstraint = GObject.registerClass({ export const MonitorConstraint = GObject.registerClass({
Properties: { Properties: {
'primary': GObject.ParamSpec.boolean('primary', 'primary': GObject.ParamSpec.boolean(
'Primary', 'Track primary monitor', 'primary', 'Primary', 'Track primary monitor',
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE, GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
false), false),
'index': GObject.ParamSpec.int('index', 'index': GObject.ParamSpec.int(
'Monitor index', 'Track specific monitor', 'index', 'Monitor index', 'Track specific monitor',
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE, GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
-1, 64, -1), -1, 64, -1),
'work-area': GObject.ParamSpec.boolean('work-area', 'work-area': GObject.ParamSpec.boolean(
'Work-area', 'Track monitor\'s work-area', 'work-area', 'Work-area', 'Track monitor\'s work-area',
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE, GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
false), false),
}, },
}, class MonitorConstraint extends Clutter.Constraint { }, class MonitorConstraint extends Clutter.Constraint {
_init(props) { _init(props) {
@ -284,7 +284,7 @@ export const LayoutManager = GObject.registerClass({
trackFullscreen: true, trackFullscreen: true,
}); });
this.panelBox.connect('notify::allocation', this.panelBox.connect('notify::allocation',
this._panelBoxChanged.bind(this)); this._panelBoxChanged.bind(this));
this.modalDialogGroup = new St.Widget({ this.modalDialogGroup = new St.Widget({
name: 'modalDialogGroup', name: 'modalDialogGroup',
@ -325,12 +325,12 @@ export const LayoutManager = GObject.registerClass({
}); });
this._interfaceSettings.connect('changed::enable-hot-corners', this._interfaceSettings.connect('changed::enable-hot-corners',
this._updateHotCorners.bind(this)); this._updateHotCorners.bind(this));
// Need to update struts on new workspaces when they are added // Need to update struts on new workspaces when they are added
let workspaceManager = global.workspace_manager; let workspaceManager = global.workspace_manager;
workspaceManager.connect('notify::n-workspaces', workspaceManager.connect('notify::n-workspaces',
this._queueUpdateRegions.bind(this)); this._queueUpdateRegions.bind(this));
let display = global.display; let display = global.display;
display.connect('restacked', display.connect('restacked',
@ -387,8 +387,8 @@ export const LayoutManager = GObject.registerClass({
let nMonitors = display.get_n_monitors(); let nMonitors = display.get_n_monitors();
for (let i = 0; i < nMonitors; i++) { for (let i = 0; i < nMonitors; i++) {
this.monitors.push(new Monitor(i, this.monitors.push(new Monitor(i,
display.get_monitor_geometry(i), display.get_monitor_geometry(i),
display.get_monitor_scale(i))); display.get_monitor_scale(i)));
} }
if (nMonitors == 0) { if (nMonitors == 0) {
@ -548,8 +548,9 @@ export const LayoutManager = GObject.registerClass({
} }
_updateKeyboardBox() { _updateKeyboardBox() {
this.keyboardBox.set_position(this.keyboardMonitor.x, this.keyboardBox.set_position(
this.keyboardMonitor.y + this.keyboardMonitor.height); this.keyboardMonitor.x,
this.keyboardMonitor.y + this.keyboardMonitor.height);
this.keyboardBox.set_size(this.keyboardMonitor.width, -1); this.keyboardBox.set_size(this.keyboardMonitor.width, -1);
} }
@ -1148,10 +1149,10 @@ class HotCorner extends Clutter.Actor {
this._setupFallbackCornerIfNeeded(layoutManager); this._setupFallbackCornerIfNeeded(layoutManager);
this._pressureBarrier = new PressureBarrier(HOT_CORNER_PRESSURE_THRESHOLD, this._pressureBarrier = new PressureBarrier(
HOT_CORNER_PRESSURE_TIMEOUT, HOT_CORNER_PRESSURE_THRESHOLD,
Shell.ActionMode.NORMAL | HOT_CORNER_PRESSURE_TIMEOUT,
Shell.ActionMode.OVERVIEW); Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW);
this._pressureBarrier.connect('trigger', this._toggleOverview.bind(this)); this._pressureBarrier.connect('trigger', this._toggleOverview.bind(this));
let px = 0.0; let px = 0.0;
@ -1242,9 +1243,9 @@ class HotCorner extends Clutter.Actor {
} }
this._corner.connect('enter-event', this._corner.connect('enter-event',
this._onCornerEntered.bind(this)); this._onCornerEntered.bind(this));
this._corner.connect('leave-event', this._corner.connect('leave-event',
this._onCornerLeft.bind(this)); this._onCornerLeft.bind(this));
} }
} }

View File

@ -55,7 +55,7 @@ const RadialShaderEffect = GObject.registerClass({
vfunc_build_pipeline() { vfunc_build_pipeline() {
this.add_glsl_snippet(Shell.SnippetHook.FRAGMENT, this.add_glsl_snippet(Shell.SnippetHook.FRAGMENT,
VIGNETTE_DECLARATIONS, VIGNETTE_CODE, true); VIGNETTE_DECLARATIONS, VIGNETTE_CODE, true);
} }
get brightness() { get brightness() {

View File

@ -699,9 +699,8 @@ const Inspector = GObject.registerClass({
_update(event) { _update(event) {
let [stageX, stageY] = event.get_coords(); let [stageX, stageY] = event.get_coords();
let target = global.stage.get_actor_at_pos(Clutter.PickMode.ALL, let target = global.stage.get_actor_at_pos(
stageX, Clutter.PickMode.ALL, stageX, stageY);
stageY);
if (target != this._pointerTarget) if (target != this._pointerTarget)
this._target = target; this._target = target;
@ -738,7 +737,7 @@ const Extensions = GObject.registerClass({
}); });
Main.extensionManager.connect('extension-loaded', Main.extensionManager.connect('extension-loaded',
this._loadExtension.bind(this)); this._loadExtension.bind(this));
} }
_loadExtension(o, uuid) { _loadExtension(o, uuid) {
@ -1300,17 +1299,17 @@ class LookingGlass extends St.BoxLayout {
this._interfaceSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.interface'}); this._interfaceSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.interface'});
this._interfaceSettings.connect('changed::monospace-font-name', this._interfaceSettings.connect('changed::monospace-font-name',
this._updateFont.bind(this)); this._updateFont.bind(this));
this._updateFont(); this._updateFont();
// We want it to appear to slide out from underneath the panel // We want it to appear to slide out from underneath the panel
Main.uiGroup.add_actor(this); Main.uiGroup.add_actor(this);
Main.uiGroup.set_child_below_sibling(this, Main.uiGroup.set_child_below_sibling(this,
Main.layoutManager.panelBox); Main.layoutManager.panelBox);
Main.layoutManager.panelBox.connect('notify::allocation', Main.layoutManager.panelBox.connect('notify::allocation',
this._queueResize.bind(this)); this._queueResize.bind(this));
Main.layoutManager.keyboardBox.connect('notify::allocation', Main.layoutManager.keyboardBox.connect('notify::allocation',
this._queueResize.bind(this)); this._queueResize.bind(this));
this._objInspector = new ObjInspector(this); this._objInspector = new ObjInspector(this);
Main.uiGroup.add_actor(this._objInspector); Main.uiGroup.add_actor(this._objInspector);
@ -1590,8 +1589,9 @@ class LookingGlass extends St.BoxLayout {
this.width = myWidth; this.width = myWidth;
this.height = myHeight; this.height = myHeight;
this._objInspector.set_size(Math.floor(myWidth * 0.8), Math.floor(myHeight * 0.8)); this._objInspector.set_size(Math.floor(myWidth * 0.8), Math.floor(myHeight * 0.8));
this._objInspector.set_position(this.x + Math.floor(myWidth * 0.1), this._objInspector.set_position(
this._targetY + Math.floor(myHeight * 0.1)); this.x + Math.floor(myWidth * 0.1),
this._targetY + Math.floor(myHeight * 0.1));
} }
insertObject(obj) { insertObject(obj) {
@ -1663,8 +1663,9 @@ class LookingGlass extends St.BoxLayout {
this.setBorderPaintTarget(null); this.setBorderPaintTarget(null);
let settings = St.Settings.get(); let settings = St.Settings.get();
let duration = Math.min(LG_ANIMATION_TIME / settings.slow_down_factor, let duration = Math.min(
LG_ANIMATION_TIME); LG_ANIMATION_TIME / settings.slow_down_factor,
LG_ANIMATION_TIME);
this.ease({ this.ease({
y: this._hiddenY, y: this._hiddenY,
duration, duration,

View File

@ -68,7 +68,7 @@ const MouseSpriteContent = GObject.registerClass({
let color = Clutter.Color.get_static(Clutter.StaticColor.WHITE); let color = Clutter.Color.get_static(Clutter.StaticColor.WHITE);
let [minFilter, magFilter] = actor.get_content_scaling_filters(); let [minFilter, magFilter] = actor.get_content_scaling_filters();
let textureNode = new Clutter.TextureNode(this._texture, let textureNode = new Clutter.TextureNode(this._texture,
color, minFilter, magFilter); color, minFilter, magFilter);
textureNode.set_name('MouseSpriteContent'); textureNode.set_name('MouseSpriteContent');
node.add_child(textureNode); node.add_child(textureNode);
@ -556,38 +556,38 @@ export class Magnifier extends Signals.EventEmitter {
this._settings = new Gio.Settings({schema_id: MAGNIFIER_SCHEMA}); this._settings = new Gio.Settings({schema_id: MAGNIFIER_SCHEMA});
this._settings.connect(`changed::${SCREEN_POSITION_KEY}`, this._settings.connect(`changed::${SCREEN_POSITION_KEY}`,
this._updateScreenPosition.bind(this)); this._updateScreenPosition.bind(this));
this._settings.connect(`changed::${MAG_FACTOR_KEY}`, this._settings.connect(`changed::${MAG_FACTOR_KEY}`,
this._updateMagFactor.bind(this)); this._updateMagFactor.bind(this));
this._settings.connect(`changed::${LENS_MODE_KEY}`, this._settings.connect(`changed::${LENS_MODE_KEY}`,
this._updateLensMode.bind(this)); this._updateLensMode.bind(this));
this._settings.connect(`changed::${CLAMP_MODE_KEY}`, this._settings.connect(`changed::${CLAMP_MODE_KEY}`,
this._updateClampMode.bind(this)); this._updateClampMode.bind(this));
this._settings.connect(`changed::${MOUSE_TRACKING_KEY}`, this._settings.connect(`changed::${MOUSE_TRACKING_KEY}`,
this._updateMouseTrackingMode.bind(this)); this._updateMouseTrackingMode.bind(this));
this._settings.connect(`changed::${FOCUS_TRACKING_KEY}`, this._settings.connect(`changed::${FOCUS_TRACKING_KEY}`,
this._updateFocusTrackingMode.bind(this)); this._updateFocusTrackingMode.bind(this));
this._settings.connect(`changed::${CARET_TRACKING_KEY}`, this._settings.connect(`changed::${CARET_TRACKING_KEY}`,
this._updateCaretTrackingMode.bind(this)); this._updateCaretTrackingMode.bind(this));
this._settings.connect(`changed::${INVERT_LIGHTNESS_KEY}`, this._settings.connect(`changed::${INVERT_LIGHTNESS_KEY}`,
this._updateInvertLightness.bind(this)); this._updateInvertLightness.bind(this));
this._settings.connect(`changed::${COLOR_SATURATION_KEY}`, this._settings.connect(`changed::${COLOR_SATURATION_KEY}`,
this._updateColorSaturation.bind(this)); this._updateColorSaturation.bind(this));
this._settings.connect(`changed::${BRIGHT_RED_KEY}`, this._settings.connect(`changed::${BRIGHT_RED_KEY}`,
this._updateBrightness.bind(this)); this._updateBrightness.bind(this));
this._settings.connect(`changed::${BRIGHT_GREEN_KEY}`, this._settings.connect(`changed::${BRIGHT_GREEN_KEY}`,
this._updateBrightness.bind(this)); this._updateBrightness.bind(this));
this._settings.connect(`changed::${BRIGHT_BLUE_KEY}`, this._settings.connect(`changed::${BRIGHT_BLUE_KEY}`,
this._updateBrightness.bind(this)); this._updateBrightness.bind(this));
this._settings.connect(`changed::${CONTRAST_RED_KEY}`, this._settings.connect(`changed::${CONTRAST_RED_KEY}`,
this._updateContrast.bind(this)); this._updateContrast.bind(this));
this._settings.connect(`changed::${CONTRAST_GREEN_KEY}`, this._settings.connect(`changed::${CONTRAST_GREEN_KEY}`,
this._updateContrast.bind(this)); this._updateContrast.bind(this));
this._settings.connect(`changed::${CONTRAST_BLUE_KEY}`, this._settings.connect(`changed::${CONTRAST_BLUE_KEY}`,
this._updateContrast.bind(this)); this._updateContrast.bind(this));
this._settings.connect(`changed::${SHOW_CROSS_HAIRS_KEY}`, () => { this._settings.connect(`changed::${SHOW_CROSS_HAIRS_KEY}`, () => {
this.setCrosshairsVisible(this._settings.get_boolean(SHOW_CROSS_HAIRS_KEY)); this.setCrosshairsVisible(this._settings.get_boolean(SHOW_CROSS_HAIRS_KEY));
@ -807,7 +807,7 @@ class ZoomRegion {
this._signalConnections = []; this._signalConnections = [];
let id = Main.layoutManager.connect('monitors-changed', let id = Main.layoutManager.connect('monitors-changed',
this._monitorsChanged.bind(this)); this._monitorsChanged.bind(this));
this._signalConnections.push([Main.layoutManager, id]); this._signalConnections.push([Main.layoutManager, id]);
id = this._focusCaretTracker.connect('caret-moved', this._updateCaret.bind(this)); id = this._focusCaretTracker.connect('caret-moved', this._updateCaret.bind(this));
@ -1889,8 +1889,9 @@ class Crosshairs extends Clutter.Actor {
this._clones.push(crosshairsActor); this._clones.push(crosshairsActor);
// Clones don't share visibility. // Clones don't share visibility.
this.bind_property('visible', crosshairsActor, 'visible', this.bind_property('visible',
GObject.BindingFlags.SYNC_CREATE); crosshairsActor, 'visible',
GObject.BindingFlags.SYNC_CREATE);
} }
container.add_actor(crosshairsActor); container.add_actor(crosshairsActor);

View File

@ -107,15 +107,14 @@ function _sessionUpdated() {
if (sessionMode.isPrimary) if (sessionMode.isPrimary)
_loadDefaultStylesheet(); _loadDefaultStylesheet();
wm.allowKeybinding('overlay-key', Shell.ActionMode.NORMAL | wm.allowKeybinding('overlay-key',
Shell.ActionMode.OVERVIEW); Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW);
wm.allowKeybinding('locate-pointer-key', Shell.ActionMode.ALL); wm.allowKeybinding('locate-pointer-key', Shell.ActionMode.ALL);
wm.setCustomKeybindingHandler('panel-run-dialog', wm.setCustomKeybindingHandler('panel-run-dialog',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW, sessionMode.hasRunDialog ? openRunDialog : null);
sessionMode.hasRunDialog ? openRunDialog : null);
if (!sessionMode.hasRunDialog) { if (!sessionMode.hasRunDialog) {
if (runDialog) if (runDialog)

View File

@ -216,12 +216,10 @@ class ScaleLayout extends Clutter.BinLayout {
const LabelExpanderLayout = GObject.registerClass({ const LabelExpanderLayout = GObject.registerClass({
Properties: { Properties: {
'expansion': GObject.ParamSpec.double('expansion', 'expansion': GObject.ParamSpec.double(
'Expansion', 'expansion', 'Expansion', 'Expansion',
'Expansion of the layout, between 0 (collapsed) ' + GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
'and 1 (fully expanded', 0, 1, 0),
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
0, 1, 0),
}, },
}, class LabelExpanderLayout extends Clutter.LayoutManager { }, class LabelExpanderLayout extends Clutter.LayoutManager {
_init(params) { _init(params) {
@ -418,7 +416,7 @@ export const Message = GObject.registerClass({
setBody(text) { setBody(text) {
this._bodyText = text; this._bodyText = text;
this.bodyLabel.setMarkup(text ? text.replace(/\n/g, ' ') : '', this.bodyLabel.setMarkup(text ? text.replace(/\n/g, ' ') : '',
this._useBodyMarkup); this._useBodyMarkup);
if (this._expandedLabel) if (this._expandedLabel)
this._expandedLabel.setMarkup(text, this._useBodyMarkup); this._expandedLabel.setMarkup(text, this._useBodyMarkup);
} }
@ -479,7 +477,7 @@ export const Message = GObject.registerClass({
if (this._bodyStack.get_n_children() < 2) { if (this._bodyStack.get_n_children() < 2) {
this._expandedLabel = new URLHighlighter(this._bodyText, this._expandedLabel = new URLHighlighter(this._bodyText,
true, this._useBodyMarkup); true, this._useBodyMarkup);
this.setExpandedBody(this._expandedLabel); this.setExpandedBody(this._expandedLabel);
} }

View File

@ -831,8 +831,8 @@ export const MessageTray = GObject.registerClass({
let constraint = new Layout.MonitorConstraint({primary: true}); let constraint = new Layout.MonitorConstraint({primary: true});
Main.layoutManager.panelBox.bind_property('visible', Main.layoutManager.panelBox.bind_property('visible',
constraint, 'work-area', constraint, 'work-area',
GObject.BindingFlags.SYNC_CREATE); GObject.BindingFlags.SYNC_CREATE);
this.add_constraint(constraint); this.add_constraint(constraint);
this._bannerBin = new St.Widget({ this._bannerBin = new St.Widget({
@ -846,9 +846,9 @@ export const MessageTray = GObject.registerClass({
layout_manager: new Clutter.BinLayout(), layout_manager: new Clutter.BinLayout(),
}); });
this._bannerBin.connect('key-release-event', this._bannerBin.connect('key-release-event',
this._onNotificationKeyRelease.bind(this)); this._onNotificationKeyRelease.bind(this));
this._bannerBin.connect('notify::hover', this._bannerBin.connect('notify::hover',
this._onNotificationHoverChanged.bind(this)); this._onNotificationHoverChanged.bind(this));
this.add_actor(this._bannerBin); this.add_actor(this._bannerBin);
this._notificationFocusGrabber = new FocusGrabber(this._bannerBin); this._notificationFocusGrabber = new FocusGrabber(this._bannerBin);
@ -885,30 +885,29 @@ export const MessageTray = GObject.registerClass({
Main.sessionMode.connect('updated', this._sessionUpdated.bind(this)); Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
Main.overview.connect('window-drag-begin', Main.overview.connect('window-drag-begin',
this._onDragBegin.bind(this)); this._onDragBegin.bind(this));
Main.overview.connect('window-drag-cancelled', Main.overview.connect('window-drag-cancelled',
this._onDragEnd.bind(this)); this._onDragEnd.bind(this));
Main.overview.connect('window-drag-end', Main.overview.connect('window-drag-end',
this._onDragEnd.bind(this)); this._onDragEnd.bind(this));
Main.overview.connect('item-drag-begin', Main.overview.connect('item-drag-begin',
this._onDragBegin.bind(this)); this._onDragBegin.bind(this));
Main.overview.connect('item-drag-cancelled', Main.overview.connect('item-drag-cancelled',
this._onDragEnd.bind(this)); this._onDragEnd.bind(this));
Main.overview.connect('item-drag-end', Main.overview.connect('item-drag-end',
this._onDragEnd.bind(this)); this._onDragEnd.bind(this));
Main.xdndHandler.connect('drag-begin', Main.xdndHandler.connect('drag-begin',
this._onDragBegin.bind(this)); this._onDragBegin.bind(this));
Main.xdndHandler.connect('drag-end', Main.xdndHandler.connect('drag-end',
this._onDragEnd.bind(this)); this._onDragEnd.bind(this));
Main.wm.addKeybinding('focus-active-notification', Main.wm.addKeybinding('focus-active-notification',
new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}), new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.NONE, Meta.KeyBindingFlags.NONE,
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW, this._expandActiveNotification.bind(this));
this._expandActiveNotification.bind(this));
this._sources = new Set(); this._sources = new Set();
@ -1044,7 +1043,7 @@ export const MessageTray = GObject.registerClass({
let full = this.queueCount + bannerCount >= MAX_NOTIFICATIONS_IN_QUEUE; let full = this.queueCount + bannerCount >= MAX_NOTIFICATIONS_IN_QUEUE;
if (!full || notification.urgency == Urgency.CRITICAL) { if (!full || notification.urgency == Urgency.CRITICAL) {
notification.connect('destroy', notification.connect('destroy',
this._onNotificationDestroy.bind(this)); this._onNotificationDestroy.bind(this));
this._notificationQueue.push(notification); this._notificationQueue.push(notification);
this._notificationQueue.sort( this._notificationQueue.sort(
(n1, n2) => n2.urgency - n1.urgency); (n1, n2) => n2.urgency - n1.urgency);

View File

@ -26,11 +26,12 @@ export const State = {
export const ModalDialog = GObject.registerClass({ export const ModalDialog = GObject.registerClass({
Properties: { Properties: {
'state': GObject.ParamSpec.int('state', 'Dialog state', 'state', 'state': GObject.ParamSpec.int(
GObject.ParamFlags.READABLE, 'state', 'Dialog state', 'state',
Math.min(...Object.values(State)), GObject.ParamFlags.READABLE,
Math.max(...Object.values(State)), Math.min(...Object.values(State)),
State.CLOSED), Math.max(...Object.values(State)),
State.CLOSED),
}, },
Signals: {'opened': {}, 'closed': {}}, Signals: {'opened': {}, 'closed': {}},
}, class ModalDialog extends St.Widget { }, class ModalDialog extends St.Widget {

View File

@ -254,9 +254,9 @@ class MediaSection extends MessageList.MessageListSection {
this._players = new Map(); this._players = new Map();
this._proxy = new DBusProxy(Gio.DBus.session, this._proxy = new DBusProxy(Gio.DBus.session,
'org.freedesktop.DBus', 'org.freedesktop.DBus',
'/org/freedesktop/DBus', '/org/freedesktop/DBus',
this._onProxyReady.bind(this)); this._onProxyReady.bind(this));
} }
get allowed() { get allowed() {
@ -294,7 +294,7 @@ class MediaSection extends MessageList.MessageListSection {
this._addPlayer(name); this._addPlayer(name);
}); });
this._proxy.connectSignal('NameOwnerChanged', this._proxy.connectSignal('NameOwnerChanged',
this._onNameOwnerChanged.bind(this)); this._onNameOwnerChanged.bind(this));
} }
_onNameOwnerChanged(proxy, sender, [name, oldOwner, newOwner]) { _onNameOwnerChanged(proxy, sender, [name, oldOwner, newOwner]) {

View File

@ -48,8 +48,13 @@ class FdoNotificationDaemon {
width, height, rowStride, hasAlpha, width, height, rowStride, hasAlpha,
bitsPerSample, nChannels_, data, bitsPerSample, nChannels_, data,
] = hints['image-data']; ] = hints['image-data'];
return Shell.util_create_pixbuf_from_data(data, GdkPixbuf.Colorspace.RGB, hasAlpha, return Shell.util_create_pixbuf_from_data(data,
bitsPerSample, width, height, rowStride); GdkPixbuf.Colorspace.RGB,
hasAlpha,
bitsPerSample,
width,
height,
rowStride);
} else if (hints['image-path']) { } else if (hints['image-path']) {
return this._iconForNotificationData(hints['image-path']); return this._iconForNotificationData(hints['image-path']);
} }
@ -329,12 +334,12 @@ class FdoNotificationDaemon {
_emitNotificationClosed(id, reason) { _emitNotificationClosed(id, reason) {
this._dbusImpl.emit_signal('NotificationClosed', this._dbusImpl.emit_signal('NotificationClosed',
GLib.Variant.new('(uu)', [id, reason])); GLib.Variant.new('(uu)', [id, reason]));
} }
_emitActionInvoked(id, action) { _emitActionInvoked(id, action) {
this._dbusImpl.emit_signal('ActionInvoked', this._dbusImpl.emit_signal('ActionInvoked',
GLib.Variant.new('(us)', [id, action])); GLib.Variant.new('(us)', [id, action]));
} }
} }
@ -354,9 +359,9 @@ class FdoNotificationDaemonSource extends MessageTray.Source {
if (sender) { if (sender) {
this._nameWatcherId = Gio.DBus.session.watch_name(sender, this._nameWatcherId = Gio.DBus.session.watch_name(sender,
Gio.BusNameWatcherFlags.NONE, Gio.BusNameWatcherFlags.NONE,
null, null,
this._onNameVanished.bind(this)); this._onNameVanished.bind(this));
} else { } else {
this._nameWatcherId = 0; this._nameWatcherId = 0;
} }

View File

@ -57,7 +57,7 @@ export class OsdMonitorLabeler {
this._osdLabels = []; this._osdLabels = [];
this._monitorLabels = null; this._monitorLabels = null;
Main.layoutManager.connect('monitors-changed', Main.layoutManager.connect('monitors-changed',
this._reset.bind(this)); this._reset.bind(this));
this._reset(); this._reset();
} }
@ -76,10 +76,11 @@ export class OsdMonitorLabeler {
return this._client == client; return this._client == client;
this._client = client; this._client = client;
this._clientWatchId = Gio.bus_watch_name(Gio.BusType.SESSION, client, 0, null, this._clientWatchId = Gio.bus_watch_name(Gio.BusType.SESSION,
(c, name) => { client, 0, null,
this.hide(name); (c, name) => {
}); this.hide(name);
});
return true; return true;
} }

View File

@ -148,7 +148,7 @@ export class OsdWindowManager {
constructor() { constructor() {
this._osdWindows = []; this._osdWindows = [];
Main.layoutManager.connect('monitors-changed', Main.layoutManager.connect('monitors-changed',
this._monitorsChanged.bind(this)); this._monitorsChanged.bind(this));
this._monitorsChanged(); this._monitorsChanged();
} }

View File

@ -223,7 +223,7 @@ export class Overview extends Signals.EventEmitter {
Main.layoutManager.overviewGroup.connect('scroll-event', Main.layoutManager.overviewGroup.connect('scroll-event',
this._onScrollEvent.bind(this)); this._onScrollEvent.bind(this));
Main.xdndHandler.connect('drag-begin', this._onDragBegin.bind(this)); Main.xdndHandler.connect('drag-begin', this._onDragBegin.bind(this));
Main.xdndHandler.connect('drag-end', this._onDragEnd.bind(this)); Main.xdndHandler.connect('drag-end', this._onDragEnd.bind(this));
@ -367,7 +367,7 @@ export class Overview extends Signals.EventEmitter {
() => { () => {
this._windowSwitchTimeoutId = 0; this._windowSwitchTimeoutId = 0;
Main.activateWindow(dragEvent.targetActor._delegate.metaWindow, Main.activateWindow(dragEvent.targetActor._delegate.metaWindow,
this._windowSwitchTimestamp); this._windowSwitchTimestamp);
this.hide(); this.hide();
this._lastHoveredWindow = null; this._lastHoveredWindow = null;
return GLib.SOURCE_REMOVE; return GLib.SOURCE_REMOVE;

View File

@ -292,21 +292,18 @@ const ActionEditor = GObject.registerClass({
const PadDiagram = GObject.registerClass({ const PadDiagram = GObject.registerClass({
Properties: { Properties: {
'left-handed': GObject.ParamSpec.boolean('left-handed', 'left-handed': GObject.ParamSpec.boolean(
'left-handed', 'Left handed', 'left-handed', 'left-handed', 'Left handed',
GObject.ParamFlags.READWRITE | GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
GObject.ParamFlags.CONSTRUCT_ONLY, false),
false), 'image': GObject.ParamSpec.string(
'image': GObject.ParamSpec.string('image', 'image', 'Image', 'image', 'image', 'Image',
GObject.ParamFlags.READWRITE | GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
GObject.ParamFlags.CONSTRUCT_ONLY, null),
null), 'editor-actor': GObject.ParamSpec.object(
'editor-actor': GObject.ParamSpec.object('editor-actor', 'editor-actor', 'editor-actor', 'Editor actor',
'editor-actor', GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
'Editor actor', Clutter.Actor.$gtype),
GObject.ParamFlags.READWRITE |
GObject.ParamFlags.CONSTRUCT_ONLY,
Clutter.Actor.$gtype),
}, },
}, class PadDiagram extends St.DrawingArea { }, class PadDiagram extends St.DrawingArea {
_init(params) { _init(params) {
@ -899,8 +896,9 @@ export const PadOsd = GObject.registerClass({
this._editedAction = {type, number, dir, mode}; this._editedAction = {type, number, dir, mode};
const settingsPath = `${this._settings.path}${key}/`; const settingsPath = `${this._settings.path}${key}/`;
this._editedActionSettings = Gio.Settings.new_with_path('org.gnome.desktop.peripherals.tablet.pad-button', this._editedActionSettings = Gio.Settings.new_with_path(
settingsPath); 'org.gnome.desktop.peripherals.tablet.pad-button',
settingsPath);
this._actionEditor.setSettings(this._editedActionSettings, type); this._actionEditor.setSettings(this._editedActionSettings, type);
this._padDiagram.startEdition(type, number, dir); this._padDiagram.startEdition(type, number, dir);
} }
@ -964,9 +962,10 @@ export class PadOsdService extends Signals.EventEmitter {
}); });
if (padDevice == null) { if (padDevice == null) {
invocation.return_error_literal(Gio.IOErrorEnum, invocation.return_error_literal(
Gio.IOErrorEnum.CANCELLED, Gio.IOErrorEnum,
'Invalid params'); Gio.IOErrorEnum.CANCELLED,
'Invalid params');
return; return;
} }

View File

@ -79,7 +79,7 @@ const AppMenuButton = GObject.registerClass({
let textureCache = St.TextureCache.get_default(); let textureCache = St.TextureCache.get_default();
textureCache.connect('icon-theme-changed', textureCache.connect('icon-theme-changed',
this._onIconThemeChanged.bind(this)); this._onIconThemeChanged.bind(this));
let iconEffect = new Clutter.DesaturateEffect(); let iconEffect = new Clutter.DesaturateEffect();
this._iconBox = new St.Bin({ this._iconBox = new St.Bin({
@ -496,8 +496,9 @@ class Panel extends St.Widget {
}); });
Main.layoutManager.panelBox.add(this); Main.layoutManager.panelBox.add(this);
Main.ctrlAltTabManager.addGroup(this, _('Top Bar'), 'focus-top-bar-symbolic', Main.ctrlAltTabManager.addGroup(this,
{sortGroup: CtrlAltTab.SortGroup.TOP}); _('Top Bar'), 'focus-top-bar-symbolic',
{sortGroup: CtrlAltTab.SortGroup.TOP});
Main.sessionMode.connect('updated', this._updatePanel.bind(this)); Main.sessionMode.connect('updated', this._updatePanel.bind(this));
@ -542,14 +543,13 @@ class Panel extends St.Widget {
childBox.y1 = 0; childBox.y1 = 0;
childBox.y2 = allocHeight; childBox.y2 = allocHeight;
if (this.get_text_direction() == Clutter.TextDirection.RTL) { if (this.get_text_direction() == Clutter.TextDirection.RTL) {
childBox.x1 = Math.max(allocWidth - Math.min(Math.floor(sideWidth), childBox.x1 = Math.max(
leftNaturalWidth), allocWidth - Math.min(Math.floor(sideWidth), leftNaturalWidth),
0); 0);
childBox.x2 = allocWidth; childBox.x2 = allocWidth;
} else { } else {
childBox.x1 = 0; childBox.x1 = 0;
childBox.x2 = Math.min(Math.floor(sideWidth), childBox.x2 = Math.min(Math.floor(sideWidth), leftNaturalWidth);
leftNaturalWidth);
} }
this._leftBox.allocate(childBox); this._leftBox.allocate(childBox);
@ -563,12 +563,11 @@ class Panel extends St.Widget {
childBox.y2 = allocHeight; childBox.y2 = allocHeight;
if (this.get_text_direction() == Clutter.TextDirection.RTL) { if (this.get_text_direction() == Clutter.TextDirection.RTL) {
childBox.x1 = 0; childBox.x1 = 0;
childBox.x2 = Math.min(Math.floor(sideWidth), childBox.x2 = Math.min(Math.floor(sideWidth), rightNaturalWidth);
rightNaturalWidth);
} else { } else {
childBox.x1 = Math.max(allocWidth - Math.min(Math.floor(sideWidth), childBox.x1 = Math.max(
rightNaturalWidth), allocWidth - Math.min(Math.floor(sideWidth), rightNaturalWidth),
0); 0);
childBox.x2 = allocWidth; childBox.x2 = allocWidth;
} }
this._rightBox.allocate(childBox); this._rightBox.allocate(childBox);

View File

@ -65,12 +65,14 @@ export function arrowIcon(side) {
export const PopupBaseMenuItem = GObject.registerClass({ export const PopupBaseMenuItem = GObject.registerClass({
Properties: { Properties: {
'active': GObject.ParamSpec.boolean('active', 'active', 'active', 'active': GObject.ParamSpec.boolean(
GObject.ParamFlags.READWRITE, 'active', 'active', 'active',
false), GObject.ParamFlags.READWRITE,
'sensitive': GObject.ParamSpec.boolean('sensitive', 'sensitive', 'sensitive', false),
GObject.ParamFlags.READWRITE, 'sensitive': GObject.ParamSpec.boolean(
true), 'sensitive', 'sensitive', 'sensitive',
GObject.ParamFlags.READWRITE,
true),
}, },
Signals: { Signals: {
'activate': {param_types: [Clutter.Event.$gtype]}, 'activate': {param_types: [Clutter.Event.$gtype]},
@ -296,7 +298,7 @@ class PopupSeparatorMenuItem extends PopupBaseMenuItem {
this.label_actor = this.label; this.label_actor = this.label;
this.label.connect('notify::text', this.label.connect('notify::text',
this._syncVisibility.bind(this)); this._syncVisibility.bind(this));
this._syncVisibility(); this._syncVisibility();
this._separator = new St.Widget({ this._separator = new St.Widget({

View File

@ -232,8 +232,13 @@ class RemoteSearchProvider {
width, height, rowStride, hasAlpha, width, height, rowStride, hasAlpha,
bitsPerSample, nChannels_, data, bitsPerSample, nChannels_, data,
] = meta['icon-data']; ] = meta['icon-data'];
gicon = Shell.util_create_pixbuf_from_data(data, GdkPixbuf.Colorspace.RGB, hasAlpha, gicon = Shell.util_create_pixbuf_from_data(data,
bitsPerSample, width, height, rowStride); GdkPixbuf.Colorspace.RGB,
hasAlpha,
bitsPerSample,
width,
height,
rowStride);
} }
if (gicon) if (gicon)

View File

@ -103,7 +103,7 @@ export class ScreenShield extends Signals.EventEmitter {
this._loginManager = LoginManager.getLoginManager(); this._loginManager = LoginManager.getLoginManager();
this._loginManager.connect('prepare-for-sleep', this._loginManager.connect('prepare-for-sleep',
this._prepareForSleep.bind(this)); this._prepareForSleep.bind(this));
this._loginSession = null; this._loginSession = null;
this._getLoginSession(); this._getLoginSession();

View File

@ -2328,9 +2328,8 @@ export class ScreenshotService {
} }
let shooter = new Shell.Screenshot(); let shooter = new Shell.Screenshot();
shooter._watchNameId = shooter._watchNameId = Gio.bus_watch_name(Gio.BusType.SESSION,
Gio.bus_watch_name(Gio.BusType.SESSION, sender, 0, null, sender, 0, null, this._onNameVanished.bind(this));
this._onNameVanished.bind(this));
this._screenShooter.set(sender, shooter); this._screenShooter.set(sender, shooter);
@ -2460,9 +2459,10 @@ export class ScreenshotService {
let [x, y, width, height, flash, filename] = params; let [x, y, width, height, flash, filename] = params;
[x, y, width, height] = this._scaleArea(x, y, width, height); [x, y, width, height] = this._scaleArea(x, y, width, height);
if (!this._checkArea(x, y, width, height)) { if (!this._checkArea(x, y, width, height)) {
invocation.return_error_literal(Gio.IOErrorEnum, invocation.return_error_literal(
Gio.IOErrorEnum.CANCELLED, Gio.IOErrorEnum,
'Invalid params'); Gio.IOErrorEnum.CANCELLED,
'Invalid params');
return; return;
} }
let screenshot = await this._createScreenshot(invocation); let screenshot = await this._createScreenshot(invocation);
@ -2565,9 +2565,10 @@ export class ScreenshotService {
let [x, y, width, height] = params; let [x, y, width, height] = params;
[x, y, width, height] = this._scaleArea(x, y, width, height); [x, y, width, height] = this._scaleArea(x, y, width, height);
if (!this._checkArea(x, y, width, height)) { if (!this._checkArea(x, y, width, height)) {
invocation.return_error_literal(Gio.IOErrorEnum, invocation.return_error_literal(
Gio.IOErrorEnum.CANCELLED, Gio.IOErrorEnum,
'Invalid params'); Gio.IOErrorEnum.CANCELLED,
'Invalid params');
return; return;
} }
let flashspot = new Flashspot({x, y, width, height}); let flashspot = new Flashspot({x, y, width, height});

View File

@ -172,9 +172,8 @@ export async function disableHelperAutoExit() {
* within a performance automation script * within a performance automation script
*/ */
export function defineScriptEvent(name, description) { export function defineScriptEvent(name, description) {
Shell.PerfLog.get_default().define_event(`script.${name}`, Shell.PerfLog.get_default().define_event(
description, `script.${name}`, description, '');
'');
} }
/** /**
@ -218,9 +217,10 @@ function _collect(scriptModule, outputFile) {
if (outputFile) { if (outputFile) {
let f = Gio.file_new_for_path(outputFile); let f = Gio.file_new_for_path(outputFile);
let raw = f.replace(null, false, let raw = f.replace(null,
Gio.FileCreateFlags.NONE, false,
null); Gio.FileCreateFlags.NONE,
null);
let out = Gio.BufferedOutputStream.new_sized(raw, 4096); let out = Gio.BufferedOutputStream.new_sized(raw, 4096);
Shell.write_string_to_stream(out, '{\n'); Shell.write_string_to_stream(out, '{\n');
@ -264,10 +264,10 @@ function _collect(scriptModule, outputFile) {
first = false; first = false;
Shell.write_string_to_stream(out, Shell.write_string_to_stream(out,
`{ "name": ${JSON.stringify(name)},\n` + `{ "name": ${JSON.stringify(name)},\n` +
` "description": ${JSON.stringify(metric.description)},\n` + ` "description": ${JSON.stringify(metric.description)},\n` +
` "units": ${JSON.stringify(metric.units)},\n` + ` "units": ${JSON.stringify(metric.units)},\n` +
` "value": ${JSON.stringify(metric.value)} }`); ` "value": ${JSON.stringify(metric.value)} }`);
} }
Shell.write_string_to_stream(out, ' ]'); Shell.write_string_to_stream(out, ' ]');

View File

@ -135,8 +135,9 @@ class GridSearchResult extends SearchResult {
this.style_class = 'grid-search-result'; this.style_class = 'grid-search-result';
this.icon = new IconGrid.BaseIcon(this.metaInfo['name'], this.icon = new IconGrid.BaseIcon(this.metaInfo['name'], {
{createIcon: this.metaInfo['createIcon']}); createIcon: this.metaInfo['createIcon'],
});
let content = new St.Bin({ let content = new St.Bin({
child: this.icon, child: this.icon,
x_align: Clutter.ActorAlign.START, x_align: Clutter.ActorAlign.START,

View File

@ -194,8 +194,9 @@ export class SessionMode extends Signals.EventEmitter {
let params = _modes[this.currentMode]; let params = _modes[this.currentMode];
let defaults; let defaults;
if (params.parentMode) { if (params.parentMode) {
defaults = Params.parse(_modes[params.parentMode], defaults = Params.parse(
_modes[DEFAULT_MODE]); _modes[params.parentMode],
_modes[DEFAULT_MODE]);
} else { } else {
defaults = _modes[DEFAULT_MODE]; defaults = _modes[DEFAULT_MODE];
} }

View File

@ -41,9 +41,9 @@ export class GnomeShell {
this._cachedOverviewVisible = false; this._cachedOverviewVisible = false;
Main.overview.connect('showing', Main.overview.connect('showing',
this._checkOverviewVisibleChanged.bind(this)); this._checkOverviewVisibleChanged.bind(this));
Main.overview.connect('hidden', Main.overview.connect('hidden',
this._checkOverviewVisibleChanged.bind(this)); this._checkOverviewVisibleChanged.bind(this));
} }
/** /**
@ -303,8 +303,8 @@ export class GnomeShell {
this._grabbedAccelerators.set(bindingAction, sender); this._grabbedAccelerators.set(bindingAction, sender);
if (!this._grabbers.has(sender)) { if (!this._grabbers.has(sender)) {
let id = Gio.bus_watch_name(Gio.BusType.SESSION, sender, 0, null, let id = Gio.bus_watch_name(Gio.BusType.SESSION,
this._onGrabberBusNameVanished.bind(this)); sender, 0, null, this._onGrabberBusNameVanished.bind(this));
this._grabbers.set(sender, id); this._grabbers.set(sender, id);
} }
@ -409,7 +409,7 @@ class GnomeShellExtensions {
}); });
Main.extensionManager.connect('extension-state-changed', Main.extensionManager.connect('extension-state-changed',
this._extensionStateChanged.bind(this)); this._extensionStateChanged.bind(this));
} }
ListExtensions() { ListExtensions() {
@ -490,7 +490,7 @@ class GnomeShellExtensions {
new GLib.Variant('(sa{sv})', [newState.uuid, state])); new GLib.Variant('(sa{sv})', [newState.uuid, state]));
this._dbusImpl.emit_signal('ExtensionStatusChanged', this._dbusImpl.emit_signal('ExtensionStatusChanged',
GLib.Variant.new('(sis)', [newState.uuid, newState.state, newState.error])); new GLib.Variant('(sis)', [newState.uuid, newState.state, newState.error]));
} }
} }

View File

@ -141,8 +141,9 @@ export function addContextMenu(entry, params) {
params = Params.parse(params, {actionMode: Shell.ActionMode.POPUP}); params = Params.parse(params, {actionMode: Shell.ActionMode.POPUP});
entry.menu = new EntryMenu(entry); entry.menu = new EntryMenu(entry);
entry._menuManager = new PopupMenu.PopupMenuManager(entry, entry._menuManager = new PopupMenu.PopupMenuManager(entry, {
{actionMode: params.actionMode}); actionMode: params.actionMode,
});
entry._menuManager.addMenu(entry.menu); entry._menuManager.addMenu(entry.menu);
// Add an event handler to both the entry and its clutter_text; the former // Add an event handler to both the entry and its clutter_text; the former

View File

@ -65,15 +65,15 @@ export class ShellMountOperation {
this.mountOp = new Shell.MountOperation(); this.mountOp = new Shell.MountOperation();
this.mountOp.connect('ask-question', this.mountOp.connect('ask-question',
this._onAskQuestion.bind(this)); this._onAskQuestion.bind(this));
this.mountOp.connect('ask-password', this.mountOp.connect('ask-password',
this._onAskPassword.bind(this)); this._onAskPassword.bind(this));
this.mountOp.connect('show-processes-2', this.mountOp.connect('show-processes-2',
this._onShowProcesses2.bind(this)); this._onShowProcesses2.bind(this));
this.mountOp.connect('aborted', this.mountOp.connect('aborted',
this.close.bind(this)); this.close.bind(this));
this.mountOp.connect('show-unmount-progress', this.mountOp.connect('show-unmount-progress',
this._onShowUnmountProgress.bind(this)); this._onShowUnmountProgress.bind(this));
} }
_closeExistingDialog() { _closeExistingDialog() {
@ -543,8 +543,9 @@ export class GnomeShellMountOpHandler {
constructor() { constructor() {
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellMountOpIface, this); this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellMountOpIface, this);
this._dbusImpl.export(Gio.DBus.session, '/org/gtk/MountOperationHandler'); this._dbusImpl.export(Gio.DBus.session, '/org/gtk/MountOperationHandler');
Gio.bus_own_name_on_connection(Gio.DBus.session, 'org.gtk.MountOperationHandler', Gio.bus_own_name_on_connection(Gio.DBus.session,
Gio.BusNameOwnerFlags.REPLACE, null, null); 'org.gtk.MountOperationHandler',
Gio.BusNameOwnerFlags.REPLACE, null, null);
this._dialog = null; this._dialog = null;

View File

@ -46,34 +46,39 @@ class ATIndicator extends PanelMenu.Button {
let highContrast = this._buildItem(_('High Contrast'), A11Y_INTERFACE_SCHEMA, KEY_HIGH_CONTRAST); let highContrast = this._buildItem(_('High Contrast'), A11Y_INTERFACE_SCHEMA, KEY_HIGH_CONTRAST);
this.menu.addMenuItem(highContrast); this.menu.addMenuItem(highContrast);
let magnifier = this._buildItem(_('Zoom'), APPLICATIONS_SCHEMA, const magnifier = this._buildItem(_('Zoom'),
'screen-magnifier-enabled'); APPLICATIONS_SCHEMA, 'screen-magnifier-enabled');
this.menu.addMenuItem(magnifier); this.menu.addMenuItem(magnifier);
let textZoom = this._buildFontItem(); let textZoom = this._buildFontItem();
this.menu.addMenuItem(textZoom); this.menu.addMenuItem(textZoom);
let screenReader = this._buildItem(_('Screen Reader'), APPLICATIONS_SCHEMA, const screenReader = this._buildItem(_('Screen Reader'),
'screen-reader-enabled'); APPLICATIONS_SCHEMA, 'screen-reader-enabled');
this.menu.addMenuItem(screenReader); this.menu.addMenuItem(screenReader);
let screenKeyboard = this._buildItem(_('Screen Keyboard'), APPLICATIONS_SCHEMA, const screenKeyboard = this._buildItem(_('Screen Keyboard'),
'screen-keyboard-enabled'); APPLICATIONS_SCHEMA, 'screen-keyboard-enabled');
this.menu.addMenuItem(screenKeyboard); this.menu.addMenuItem(screenKeyboard);
let visualBell = this._buildItem(_('Visual Alerts'), WM_SCHEMA, KEY_VISUAL_BELL); const visualBell = this._buildItem(_('Visual Alerts'),
WM_SCHEMA, KEY_VISUAL_BELL);
this.menu.addMenuItem(visualBell); this.menu.addMenuItem(visualBell);
let stickyKeys = this._buildItem(_('Sticky Keys'), A11Y_KEYBOARD_SCHEMA, KEY_STICKY_KEYS_ENABLED); const stickyKeys = this._buildItem(_('Sticky Keys'),
A11Y_KEYBOARD_SCHEMA, KEY_STICKY_KEYS_ENABLED);
this.menu.addMenuItem(stickyKeys); this.menu.addMenuItem(stickyKeys);
let slowKeys = this._buildItem(_('Slow Keys'), A11Y_KEYBOARD_SCHEMA, KEY_SLOW_KEYS_ENABLED); const slowKeys = this._buildItem(_('Slow Keys'),
A11Y_KEYBOARD_SCHEMA, KEY_SLOW_KEYS_ENABLED);
this.menu.addMenuItem(slowKeys); this.menu.addMenuItem(slowKeys);
let bounceKeys = this._buildItem(_('Bounce Keys'), A11Y_KEYBOARD_SCHEMA, KEY_BOUNCE_KEYS_ENABLED); const bounceKeys = this._buildItem(_('Bounce Keys'),
A11Y_KEYBOARD_SCHEMA, KEY_BOUNCE_KEYS_ENABLED);
this.menu.addMenuItem(bounceKeys); this.menu.addMenuItem(bounceKeys);
let mouseKeys = this._buildItem(_('Mouse Keys'), A11Y_KEYBOARD_SCHEMA, KEY_MOUSE_KEYS_ENABLED); const mouseKeys = this._buildItem(_('Mouse Keys'),
A11Y_KEYBOARD_SCHEMA, KEY_MOUSE_KEYS_ENABLED);
this.menu.addMenuItem(mouseKeys); this.menu.addMenuItem(mouseKeys);
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());

View File

@ -201,12 +201,12 @@ class InputSourceSystemSettings extends InputSourceSettings {
this._reload(); this._reload();
Gio.DBus.system.signal_subscribe(this._BUS_NAME, Gio.DBus.system.signal_subscribe(this._BUS_NAME,
this._BUS_PROPS_IFACE, this._BUS_PROPS_IFACE,
'PropertiesChanged', 'PropertiesChanged',
this._BUS_PATH, this._BUS_PATH,
null, null,
Gio.DBusSignalFlags.NONE, Gio.DBusSignalFlags.NONE,
this._reload.bind(this)); this._reload.bind(this));
} }
async _reload() { async _reload() {
@ -330,16 +330,16 @@ export class InputSourceManager extends Signals.EventEmitter {
this._mruSourcesBackup = null; this._mruSourcesBackup = null;
this._keybindingAction = this._keybindingAction =
Main.wm.addKeybinding('switch-input-source', Main.wm.addKeybinding('switch-input-source',
new Gio.Settings({schema_id: 'org.gnome.desktop.wm.keybindings'}), new Gio.Settings({schema_id: 'org.gnome.desktop.wm.keybindings'}),
Meta.KeyBindingFlags.NONE, Meta.KeyBindingFlags.NONE,
Shell.ActionMode.ALL, Shell.ActionMode.ALL,
this._switchInputSource.bind(this)); this._switchInputSource.bind(this));
this._keybindingActionBackward = this._keybindingActionBackward =
Main.wm.addKeybinding('switch-input-source-backward', Main.wm.addKeybinding('switch-input-source-backward',
new Gio.Settings({schema_id: 'org.gnome.desktop.wm.keybindings'}), new Gio.Settings({schema_id: 'org.gnome.desktop.wm.keybindings'}),
Meta.KeyBindingFlags.IS_REVERSED, Meta.KeyBindingFlags.IS_REVERSED,
Shell.ActionMode.ALL, Shell.ActionMode.ALL,
this._switchInputSource.bind(this)); this._switchInputSource.bind(this));
if (Main.sessionMode.isGreeter) if (Main.sessionMode.isGreeter)
this._settings = new InputSourceSystemSettings(); this._settings = new InputSourceSystemSettings();
else else
@ -601,10 +601,10 @@ export class InputSourceManager extends Signals.EventEmitter {
let inputSourcesByShortName = {}; let inputSourcesByShortName = {};
for (let i = 0; i < infosList.length; i++) { for (let i = 0; i < infosList.length; i++) {
let is = new InputSource(infosList[i].type, let is = new InputSource(infosList[i].type,
infosList[i].id, infosList[i].id,
infosList[i].displayName, infosList[i].displayName,
infosList[i].shortName, infosList[i].shortName,
i); i);
is.connect('activate', this.activateInputSource.bind(this)); is.connect('activate', this.activateInputSource.bind(this));
if (!(is.shortName in inputSourcesByShortName)) if (!(is.shortName in inputSourcesByShortName))
@ -752,7 +752,7 @@ export class InputSourceManager extends Signals.EventEmitter {
if (this._sourcesPerWindow && this._focusWindowNotifyId == 0) { if (this._sourcesPerWindow && this._focusWindowNotifyId == 0) {
this._focusWindowNotifyId = global.display.connect('notify::focus-window', this._focusWindowNotifyId = global.display.connect('notify::focus-window',
this._setPerWindowInputSource.bind(this)); this._setPerWindowInputSource.bind(this));
Main.overview.connectObject( Main.overview.connectObject(
'showing', this._setPerWindowInputSource.bind(this), 'showing', this._setPerWindowInputSource.bind(this),
'hidden', this._setPerWindowInputSource.bind(this), this); 'hidden', this._setPerWindowInputSource.bind(this), this);
@ -1020,13 +1020,13 @@ class InputSourceIndicator extends PanelMenu.Button {
if (group[j] == item) { if (group[j] == item) {
item.setOrnament(PopupMenu.Ornament.DOT); item.setOrnament(PopupMenu.Ornament.DOT);
item.prop.set_state(IBus.PropState.CHECKED); item.prop.set_state(IBus.PropState.CHECKED);
ibusManager.activateProperty(item.prop.get_key(), ibusManager.activateProperty(
IBus.PropState.CHECKED); item.prop.get_key(), IBus.PropState.CHECKED);
} else { } else {
group[j].setOrnament(PopupMenu.Ornament.NONE); group[j].setOrnament(PopupMenu.Ornament.NONE);
group[j].prop.set_state(IBus.PropState.UNCHECKED); group[j].prop.set_state(IBus.PropState.UNCHECKED);
ibusManager.activateProperty(group[j].prop.get_key(), ibusManager.activateProperty(
IBus.PropState.UNCHECKED); group[j].prop.get_key(), IBus.PropState.UNCHECKED);
} }
} }
}); });
@ -1038,12 +1038,12 @@ class InputSourceIndicator extends PanelMenu.Button {
item.connect('toggled', () => { item.connect('toggled', () => {
if (item.state) { if (item.state) {
item.prop.set_state(IBus.PropState.CHECKED); item.prop.set_state(IBus.PropState.CHECKED);
ibusManager.activateProperty(item.prop.get_key(), ibusManager.activateProperty(
IBus.PropState.CHECKED); item.prop.get_key(), IBus.PropState.CHECKED);
} else { } else {
item.prop.set_state(IBus.PropState.UNCHECKED); item.prop.set_state(IBus.PropState.UNCHECKED);
ibusManager.activateProperty(item.prop.get_key(), ibusManager.activateProperty(
IBus.PropState.UNCHECKED); item.prop.get_key(), IBus.PropState.UNCHECKED);
} }
}); });
break; break;
@ -1052,8 +1052,8 @@ class InputSourceIndicator extends PanelMenu.Button {
item = new PopupMenu.PopupMenuItem(prop.get_label().get_text()); item = new PopupMenu.PopupMenuItem(prop.get_label().get_text());
item.prop = prop; item.prop = prop;
item.connect('activate', () => { item.connect('activate', () => {
ibusManager.activateProperty(item.prop.get_key(), ibusManager.activateProperty(
item.prop.get_state()); item.prop.get_key(), item.prop.get_state());
}); });
break; break;

View File

@ -87,10 +87,10 @@ const GeoclueAgent = GObject.registerClass({
this.connect('notify::enabled', this._onMaxAccuracyLevelChanged.bind(this)); this.connect('notify::enabled', this._onMaxAccuracyLevelChanged.bind(this));
this._watchId = Gio.bus_watch_name(Gio.BusType.SYSTEM, this._watchId = Gio.bus_watch_name(Gio.BusType.SYSTEM,
'org.freedesktop.GeoClue2', 'org.freedesktop.GeoClue2',
0, 0,
this._connectToGeoclue.bind(this), this._connectToGeoclue.bind(this),
this._onGeoclueVanished.bind(this)); this._onGeoclueVanished.bind(this));
this._onMaxAccuracyLevelChanged(); this._onMaxAccuracyLevelChanged();
this._connectToGeoclue(); this._connectToGeoclue();
this._connectToPermissionStore(); this._connectToPermissionStore();
@ -140,9 +140,9 @@ const GeoclueAgent = GObject.registerClass({
this._connecting = true; this._connecting = true;
new GeoclueManager(Gio.DBus.system, new GeoclueManager(Gio.DBus.system,
'org.freedesktop.GeoClue2', 'org.freedesktop.GeoClue2',
'/org/freedesktop/GeoClue2/Manager', '/org/freedesktop/GeoClue2/Manager',
this._onManagerProxyReady.bind(this)); this._onManagerProxyReady.bind(this));
return true; return true;
} }

View File

@ -97,9 +97,7 @@ class Client extends Signals.EventEmitter {
_onDeviceAdded(proxy, emitter, params) { _onDeviceAdded(proxy, emitter, params) {
let [path] = params; let [path] = params;
let device = new BoltDeviceProxy(Gio.DBus.system, let device = new BoltDeviceProxy(Gio.DBus.system, BOLT_DBUS_NAME, path);
BOLT_DBUS_NAME,
path);
this.emit('device-added', device); this.emit('device-added', device);
} }
@ -187,7 +185,7 @@ class AuthRobot extends Signals.EventEmitter {
this._enrolling = true; this._enrolling = true;
GLib.idle_add(GLib.PRIORITY_DEFAULT, GLib.idle_add(GLib.PRIORITY_DEFAULT,
this._enrollDevicesIdle.bind(this)); this._enrollDevicesIdle.bind(this));
} }
async _enrollDevicesIdle() { async _enrollDevicesIdle() {
@ -259,7 +257,7 @@ class Indicator extends SystemIndicator {
_ensureSource() { _ensureSource() {
if (!this._source) { if (!this._source) {
this._source = new MessageTray.Source(_('Thunderbolt'), this._source = new MessageTray.Source(_('Thunderbolt'),
'thunderbolt-symbolic'); 'thunderbolt-symbolic');
this._source.connect('destroy', () => (this._source = null)); this._source.connect('destroy', () => (this._source = null));
Main.messageTray.add(this._source); Main.messageTray.add(this._source);

View File

@ -190,8 +190,9 @@ class UserWidget extends St.BoxLayout {
this._label = new UserWidgetLabel(user); this._label = new UserWidgetLabel(user);
this.add_child(this._label); this.add_child(this._label);
this._label.bind_property('label-actor', this, 'label-actor', this._label.bind_property('label-actor',
GObject.BindingFlags.SYNC_CREATE); this, 'label-actor',
GObject.BindingFlags.SYNC_CREATE);
this._user.connectObject( this._user.connectObject(
'notify::is-loaded', this._updateUser.bind(this), 'notify::is-loaded', this._updateUser.bind(this),

View File

@ -196,17 +196,17 @@ class WorkspaceTracker {
let workspaceManager = global.workspace_manager; let workspaceManager = global.workspace_manager;
workspaceManager.connect('notify::n-workspaces', workspaceManager.connect('notify::n-workspaces',
this._nWorkspacesChanged.bind(this)); this._nWorkspacesChanged.bind(this));
workspaceManager.connect('workspaces-reordered', () => { workspaceManager.connect('workspaces-reordered', () => {
this._workspaces.sort((a, b) => a.index() - b.index()); this._workspaces.sort((a, b) => a.index() - b.index());
}); });
global.window_manager.connect('switch-workspace', global.window_manager.connect('switch-workspace',
this._queueCheckWorkspaces.bind(this)); this._queueCheckWorkspaces.bind(this));
global.display.connect('window-entered-monitor', global.display.connect('window-entered-monitor',
this._windowEnteredMonitor.bind(this)); this._windowEnteredMonitor.bind(this));
global.display.connect('window-left-monitor', global.display.connect('window-left-monitor',
this._windowLeftMonitor.bind(this)); this._windowLeftMonitor.bind(this));
this._workspaceSettings = new Gio.Settings({schema_id: 'org.gnome.mutter'}); this._workspaceSettings = new Gio.Settings({schema_id: 'org.gnome.mutter'});
this._workspaceSettings.connect('changed::dynamic-workspaces', this._queueCheckWorkspaces.bind(this)); this._workspaceSettings.connect('changed::dynamic-workspaces', this._queueCheckWorkspaces.bind(this));
@ -897,12 +897,12 @@ export class WindowManager {
Main.osdWindowManager.show(monitorIndex, icon, label, null); Main.osdWindowManager.show(monitorIndex, icon, label, null);
}); });
this._gsdWacomProxy = new GsdWacomProxy(Gio.DBus.session, GSD_WACOM_BUS_NAME, this._gsdWacomProxy = new GsdWacomProxy(Gio.DBus.session,
GSD_WACOM_OBJECT_PATH, GSD_WACOM_BUS_NAME, GSD_WACOM_OBJECT_PATH,
(proxy, error) => { (proxy, error) => {
if (error) if (error)
log(error.message); log(error.message);
}); });
global.display.connect('pad-mode-switch', (display, pad, _group, _mode) => { global.display.connect('pad-mode-switch', (display, pad, _group, _mode) => {
let labels = []; let labels = [];
@ -1243,8 +1243,9 @@ export class WindowManager {
let [success, geom] = actor.meta_window.get_icon_geometry(); let [success, geom] = actor.meta_window.get_icon_geometry();
if (success) { if (success) {
actor.set_position(geom.x, geom.y); actor.set_position(geom.x, geom.y);
actor.set_scale(geom.width / actor.width, actor.set_scale(
geom.height / actor.height); geom.width / actor.width,
geom.height / actor.height);
} else { } else {
let monitor = Main.layoutManager.monitors[actor.meta_window.get_monitor()]; let monitor = Main.layoutManager.monitors[actor.meta_window.get_monitor()];
if (!monitor) { if (!monitor) {

View File

@ -1350,7 +1350,7 @@ class Workspace extends St.Widget {
let clone = new WindowPreview(metaWindow, this, this._overviewAdjustment); let clone = new WindowPreview(metaWindow, this, this._overviewAdjustment);
clone.connect('selected', clone.connect('selected',
this._onCloneSelected.bind(this)); this._onCloneSelected.bind(this));
clone.connect('drag-begin', () => { clone.connect('drag-begin', () => {
Main.overview.beginWindowDrag(metaWindow); Main.overview.beginWindowDrag(metaWindow);
}); });

View File

@ -904,7 +904,7 @@ export const ThumbnailsBox = GObject.registerClass({
// workspace while we wait for the startup sequence to load. // workspace while we wait for the startup sequence to load.
let workspaceManager = global.workspace_manager; let workspaceManager = global.workspace_manager;
Main.wm.keepWorkspaceAlive(workspaceManager.get_workspace_by_index(newWorkspaceIndex), Main.wm.keepWorkspaceAlive(workspaceManager.get_workspace_by_index(newWorkspaceIndex),
WORKSPACE_KEEP_ALIVE_TIME); WORKSPACE_KEEP_ALIVE_TIME);
} }
// Start the animation on the workspace (which is actually // Start the animation on the workspace (which is actually
@ -998,8 +998,9 @@ export const ThumbnailsBox = GObject.registerClass({
for (let k = start; k < start + count; k++) { for (let k = start; k < start + count; k++) {
let metaWorkspace = workspaceManager.get_workspace_by_index(k); let metaWorkspace = workspaceManager.get_workspace_by_index(k);
let thumbnail = new WorkspaceThumbnail(metaWorkspace, this._monitorIndex); let thumbnail = new WorkspaceThumbnail(metaWorkspace, this._monitorIndex);
thumbnail.setPorthole(this._porthole.x, this._porthole.y, thumbnail.setPorthole(
this._porthole.width, this._porthole.height); this._porthole.x, this._porthole.y,
this._porthole.width, this._porthole.height);
this._thumbnails.push(thumbnail); this._thumbnails.push(thumbnail);
this.add_actor(thumbnail); this.add_actor(thumbnail);

View File

@ -102,10 +102,10 @@ export class XdndHandler extends Signals.EventEmitter {
if (pickedActor._delegate && pickedActor._delegate.handleDragOver) { if (pickedActor._delegate && pickedActor._delegate.handleDragOver) {
let [r_, targX, targY] = pickedActor.transform_stage_point(x, y); let [r_, targX, targY] = pickedActor.transform_stage_point(x, y);
let result = pickedActor._delegate.handleDragOver(this, let result = pickedActor._delegate.handleDragOver(this,
dragEvent.dragActor, dragEvent.dragActor,
targX, targX,
targY, targY,
global.get_current_time()); global.get_current_time());
if (result != DND.DragMotionResult.CONTINUE) if (result != DND.DragMotionResult.CONTINUE)
return; return;
} }

View File

@ -1,12 +1,5 @@
rules: rules:
eqeqeq: off eqeqeq: off
indent:
- error
- 4
- ignoredNodes:
- 'CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child'
CallExpression:
arguments: first
jsdoc/check-alignment: off jsdoc/check-alignment: off
jsdoc/check-param-names: off jsdoc/check-param-names: off
jsdoc/check-tag-names: off jsdoc/check-tag-names: off