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,7 +70,8 @@ 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',
this, 'label-actor',
GObject.BindingFlags.SYNC_CREATE); GObject.BindingFlags.SYNC_CREATE);
this._timedLoginIndicator = new St.Bin({ this._timedLoginIndicator = new St.Bin({
@ -168,7 +169,8 @@ 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.NEVER,
St.PolicyType.AUTOMATIC); St.PolicyType.AUTOMATIC);
this._box = new St.BoxLayout({ this._box = new St.BoxLayout({
@ -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(
this._logoFile,
-1, -1, -1, -1,
scaleFactor, scaleFactor, resourceScale);
resourceScale)); this._logoBin.add_child(texture);
} }
} }

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

@ -18,8 +18,8 @@ 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,
@ -32,15 +32,13 @@ 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();
}); });

View File

@ -38,7 +38,8 @@ 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',
'/org/gnome/DisplayManager/Manager', '/org/gnome/DisplayManager/Manager',
'org.freedesktop.DBus.Properties', 'org.freedesktop.DBus.Properties',
'Get', params, null, 'Get', params, null,

View File

@ -98,7 +98,8 @@ 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(' '),
null,
Gio.AppInfoCreateFlags.SUPPORTS_STARTUP_NOTIFICATION); Gio.AppInfoCreateFlags.SUPPORTS_STARTUP_NOTIFICATION);
let context = global.create_app_launch_context(0, -1); let context = global.create_app_launch_context(0, -1);

View File

@ -270,7 +270,8 @@ 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(
geoLocation.description,
null, null,
geoLocation.latitude, geoLocation.latitude,
geoLocation.longitude); geoLocation.longitude);

View File

@ -96,7 +96,8 @@ 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,
Gio.DBusError.ACCESS_DENIED, 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,7 +142,8 @@ 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,
Gio.DBusError.LIMITS_EXCEEDED, Gio.DBusError.LIMITS_EXCEEDED,
'Already showing a system access dialog'); 'Already showing a system access dialog');
return; return;
@ -151,7 +153,8 @@ 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,
Gio.DBusError.ACCESS_DENIED, Gio.DBusError.ACCESS_DENIED,
'Only the focused app is allowed to show a system access dialog'); 'Only the focused app is allowed to show a system access dialog');
return; return;

View File

@ -142,7 +142,8 @@ 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._currentWindow + 1,
this._items[this._selectedIndex].cachedWindows.length); this._items[this._selectedIndex].cachedWindows.length);
} }
@ -150,7 +151,8 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
// 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._currentWindow - 1,
this._items[this._selectedIndex].cachedWindows.length); this._items[this._selectedIndex].cachedWindows.length);
} }
@ -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,7 +168,8 @@ 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._audioSelectionDialog._sender,
this._dbusImpl.get_object_path(), this._dbusImpl.get_object_path(),
info ? info.name : null, info ? info.name : null,
'DeviceSelected', 'DeviceSelected',

View File

@ -445,7 +445,8 @@ 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(
ANIMATION_MIN_WAKEUP_INTERVAL * 1000,
timePerStep); timePerStep);
if (interval > GLib.MAXUINT32) if (interval > GLib.MAXUINT32)

View File

@ -348,7 +348,8 @@ 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(
x2 - borderRadius, y1 + borderRadius, borderRadius,
3 * Math.PI / 2, Math.PI * 2); 3 * Math.PI / 2, Math.PI * 2);
} }
@ -369,7 +370,8 @@ 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(
x2 - borderRadius, y2 - borderRadius, borderRadius,
0, Math.PI / 2); 0, Math.PI / 2);
} }
@ -390,7 +392,8 @@ 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(
x1 + borderRadius, y2 - borderRadius, borderRadius,
Math.PI / 2, Math.PI); Math.PI / 2, Math.PI);
} }
@ -411,7 +414,8 @@ 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(
x1 + borderRadius, y1 + borderRadius, borderRadius,
Math.PI, 3 * Math.PI / 2); Math.PI, 3 * Math.PI / 2);
} }

View File

@ -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

@ -425,7 +425,8 @@ 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.title,
this._notification.bannerBodyText, this._notification.bannerBodyText,
{gicon: this.getIcon()}); {gicon: this.getIcon()});
} }
@ -631,7 +632,8 @@ 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.title,
this._notification.bannerBodyText, this._notification.bannerBodyText,
{secondaryGIcon: this.getSecondaryIcon()}); {secondaryGIcon: this.getSecondaryIcon()});
} }

View File

@ -130,8 +130,7 @@ 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,7 +99,8 @@ 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(
minHeight * this.scale_y,
natHeight * this.scale_y); natHeight * this.scale_y);
} }
@ -107,7 +108,8 @@ class DashItemContainer extends St.Widget {
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(
minWidth * this.scale_x,
natWidth * this.scale_x); natWidth * this.scale_x);
} }
@ -512,8 +514,7 @@ 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);
}); });
@ -663,7 +664,8 @@ 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.width * scale,
icon.icon.height * scale); icon.icon.height * scale);
icon.icon.ease({ icon.icon.ease({
@ -782,7 +784,8 @@ 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].item,
addedItems[i].pos); addedItems[i].pos);
} }
@ -925,7 +928,8 @@ 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._dragPlaceholder,
this._dragPlaceholderPos); this._dragPlaceholderPos);
this._dragPlaceholder.show(fadeIn); this._dragPlaceholder.show(fadeIn);
} }

View File

@ -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,7 +619,8 @@ 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.actor._delegate,
this._dragActor, this._dragActor,
targX, targX,
targY, targY,
@ -648,7 +649,8 @@ 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(
stageX + this._dragOffsetX,
stageY + this._dragOffsetY); stageY + this._dragOffsetY);
this._queueUpdateDragHover(); this._queueUpdateDragHover();
@ -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

@ -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,7 +746,8 @@ 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(
'org.gnome.Shell.ModalDialog.TypeError',
'Unknown dialog type requested'); 'Unknown dialog type requested');
return; return;
} }
@ -781,7 +780,8 @@ 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(
'org.gnome.Shell.ModalDialog.GrabError',
'Cannot grab pointer and keyboard'); '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();

View File

@ -39,16 +39,16 @@ 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),
}, },
@ -548,7 +548,8 @@ export const LayoutManager = GObject.registerClass({
} }
_updateKeyboardBox() { _updateKeyboardBox() {
this.keyboardBox.set_position(this.keyboardMonitor.x, this.keyboardBox.set_position(
this.keyboardMonitor.x,
this.keyboardMonitor.y + this.keyboardMonitor.height); 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_THRESHOLD,
HOT_CORNER_PRESSURE_TIMEOUT, HOT_CORNER_PRESSURE_TIMEOUT,
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW);
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;

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;
@ -1590,7 +1589,8 @@ 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.x + Math.floor(myWidth * 0.1),
this._targetY + Math.floor(myHeight * 0.1)); this._targetY + Math.floor(myHeight * 0.1));
} }
@ -1663,7 +1663,8 @@ 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 / settings.slow_down_factor,
LG_ANIMATION_TIME); LG_ANIMATION_TIME);
this.ease({ this.ease({
y: this._hiddenY, y: this._hiddenY,

View File

@ -1889,7 +1889,8 @@ 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',
crosshairsActor, 'visible',
GObject.BindingFlags.SYNC_CREATE); GObject.BindingFlags.SYNC_CREATE);
} }

View File

@ -107,14 +107,13 @@ 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) {

View File

@ -216,10 +216,8 @@ 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) ' +
'and 1 (fully expanded',
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE, GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
0, 1, 0), 0, 1, 0),
}, },

View File

@ -906,8 +906,7 @@ export const MessageTray = GObject.registerClass({
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();

View File

@ -26,7 +26,8 @@ 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(
'state', 'Dialog state', 'state',
GObject.ParamFlags.READABLE, GObject.ParamFlags.READABLE,
Math.min(...Object.values(State)), Math.min(...Object.values(State)),
Math.max(...Object.values(State)), Math.max(...Object.values(State)),

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']);
} }

View File

@ -76,7 +76,8 @@ 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,
client, 0, null,
(c, name) => { (c, name) => {
this.hide(name); this.hide(name);
}); });

View File

@ -292,20 +292,17 @@ 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', 'image', 'Image', 'image': GObject.ParamSpec.string(
GObject.ParamFlags.READWRITE | 'image', 'image', 'Image',
GObject.ParamFlags.CONSTRUCT_ONLY, GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
null), null),
'editor-actor': GObject.ParamSpec.object('editor-actor', 'editor-actor': GObject.ParamSpec.object(
'editor-actor', 'editor-actor', 'editor-actor', 'Editor actor',
'Editor actor', GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
GObject.ParamFlags.READWRITE |
GObject.ParamFlags.CONSTRUCT_ONLY,
Clutter.Actor.$gtype), Clutter.Actor.$gtype),
}, },
}, class PadDiagram extends St.DrawingArea { }, class PadDiagram extends St.DrawingArea {
@ -899,7 +896,8 @@ 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(
'org.gnome.desktop.peripherals.tablet.pad-button',
settingsPath); 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,7 +962,8 @@ export class PadOsdService extends Signals.EventEmitter {
}); });
if (padDevice == null) { if (padDevice == null) {
invocation.return_error_literal(Gio.IOErrorEnum, invocation.return_error_literal(
Gio.IOErrorEnum,
Gio.IOErrorEnum.CANCELLED, Gio.IOErrorEnum.CANCELLED,
'Invalid params'); 'Invalid params');
return; return;

View File

@ -496,7 +496,8 @@ 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,
_('Top Bar'), 'focus-top-bar-symbolic',
{sortGroup: CtrlAltTab.SortGroup.TOP}); {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,11 +563,10 @@ 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;
} }

View File

@ -65,10 +65,12 @@ 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(
'active', 'active', 'active',
GObject.ParamFlags.READWRITE, GObject.ParamFlags.READWRITE,
false), false),
'sensitive': GObject.ParamSpec.boolean('sensitive', 'sensitive', 'sensitive', 'sensitive': GObject.ParamSpec.boolean(
'sensitive', 'sensitive', 'sensitive',
GObject.ParamFlags.READWRITE, GObject.ParamFlags.READWRITE,
true), true),
}, },

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

@ -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,7 +2459,8 @@ 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,
Gio.IOErrorEnum.CANCELLED, Gio.IOErrorEnum.CANCELLED,
'Invalid params'); 'Invalid params');
return; return;
@ -2565,7 +2565,8 @@ 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,
Gio.IOErrorEnum.CANCELLED, Gio.IOErrorEnum.CANCELLED,
'Invalid params'); 'Invalid params');
return; return;

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,7 +217,8 @@ 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,
false,
Gio.FileCreateFlags.NONE, Gio.FileCreateFlags.NONE,
null); null);
let out = Gio.BufferedOutputStream.new_sized(raw, 4096); let out = Gio.BufferedOutputStream.new_sized(raw, 4096);

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,7 +194,8 @@ 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[params.parentMode],
_modes[DEFAULT_MODE]); _modes[DEFAULT_MODE]);
} else { } else {
defaults = _modes[DEFAULT_MODE]; defaults = _modes[DEFAULT_MODE];

View File

@ -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);
} }
@ -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

@ -543,7 +543,8 @@ 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,
'org.gtk.MountOperationHandler',
Gio.BusNameOwnerFlags.REPLACE, null, null); 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

@ -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

@ -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);
} }

View File

@ -190,7 +190,8 @@ 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',
this, 'label-actor',
GObject.BindingFlags.SYNC_CREATE); GObject.BindingFlags.SYNC_CREATE);
this._user.connectObject( this._user.connectObject(

View File

@ -897,8 +897,8 @@ 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);
@ -1243,7 +1243,8 @@ 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.width / actor.width,
geom.height / actor.height); 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()];

View File

@ -998,7 +998,8 @@ 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.x, this._porthole.y,
this._porthole.width, this._porthole.height); this._porthole.width, this._porthole.height);
this._thumbnails.push(thumbnail); this._thumbnails.push(thumbnail);
this.add_actor(thumbnail); this.add_actor(thumbnail);

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