cleanup: Port non-GObject classes to JS6 classes
ES6 finally adds standard class syntax to the language, so we can replace our custom Lang.Class framework with the new syntax. Any classes that inherit from GObject will need special treatment, so limit the port to regular javascript classes for now. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361
This commit is contained in:

committed by
Georges Basile Stavracas Neto

parent
99ce3deeb0
commit
bacfdbbb03
@ -47,12 +47,9 @@ const GSD_WACOM_OBJECT_PATH = '/org/gnome/SettingsDaemon/Wacom';
|
||||
const GsdWacomIface = loadInterfaceXML('org.gnome.SettingsDaemon.Wacom');
|
||||
const GsdWacomProxy = Gio.DBusProxy.makeProxyWrapper(GsdWacomIface);
|
||||
|
||||
var DisplayChangeDialog = new Lang.Class({
|
||||
Name: 'DisplayChangeDialog',
|
||||
Extends: ModalDialog.ModalDialog,
|
||||
|
||||
_init(wm) {
|
||||
this.parent({ styleClass: 'prompt-dialog' });
|
||||
var DisplayChangeDialog = class extends ModalDialog.ModalDialog {
|
||||
constructor(wm) {
|
||||
super({ styleClass: 'prompt-dialog' });
|
||||
|
||||
this._wm = wm;
|
||||
|
||||
@ -81,7 +78,7 @@ var DisplayChangeDialog = new Lang.Class({
|
||||
|
||||
this._timeoutId = Mainloop.timeout_add(ONE_SECOND, this._tick.bind(this));
|
||||
GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._tick');
|
||||
},
|
||||
}
|
||||
|
||||
close(timestamp) {
|
||||
if (this._timeoutId > 0) {
|
||||
@ -89,14 +86,14 @@ var DisplayChangeDialog = new Lang.Class({
|
||||
this._timeoutId = 0;
|
||||
}
|
||||
|
||||
this.parent(timestamp);
|
||||
},
|
||||
super.close(timestamp);
|
||||
}
|
||||
|
||||
_formatCountDown() {
|
||||
let fmt = ngettext("Settings changes will revert in %d second",
|
||||
"Settings changes will revert in %d seconds");
|
||||
return fmt.format(this._countDown);
|
||||
},
|
||||
}
|
||||
|
||||
_tick() {
|
||||
this._countDown--;
|
||||
@ -110,50 +107,48 @@ var DisplayChangeDialog = new Lang.Class({
|
||||
|
||||
this._content.body = this._formatCountDown();
|
||||
return GLib.SOURCE_CONTINUE;
|
||||
},
|
||||
}
|
||||
|
||||
_onFailure() {
|
||||
this._wm.complete_display_change(false);
|
||||
this.close();
|
||||
},
|
||||
}
|
||||
|
||||
_onSuccess() {
|
||||
this._wm.complete_display_change(true);
|
||||
this.close();
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var WindowDimmer = new Lang.Class({
|
||||
Name: 'WindowDimmer',
|
||||
|
||||
_init(actor) {
|
||||
var WindowDimmer = class {
|
||||
constructor(actor) {
|
||||
this._brightnessEffect = new Clutter.BrightnessContrastEffect();
|
||||
actor.add_effect(this._brightnessEffect);
|
||||
this.actor = actor;
|
||||
this._enabled = true;
|
||||
this._dimFactor = 0.0;
|
||||
this._syncEnabled();
|
||||
},
|
||||
}
|
||||
|
||||
_syncEnabled() {
|
||||
this._brightnessEffect.enabled = (this._enabled && this._dimFactor > 0);
|
||||
},
|
||||
}
|
||||
|
||||
setEnabled(enabled) {
|
||||
this._enabled = enabled;
|
||||
this._syncEnabled();
|
||||
},
|
||||
}
|
||||
|
||||
set dimFactor(factor) {
|
||||
this._dimFactor = factor;
|
||||
this._brightnessEffect.set_brightness(factor * DIM_BRIGHTNESS);
|
||||
this._syncEnabled();
|
||||
},
|
||||
}
|
||||
|
||||
get dimFactor() {
|
||||
return this._dimFactor;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function getWindowDimmer(actor) {
|
||||
let enabled = Meta.prefs_get_attach_modal_dialogs();
|
||||
@ -177,10 +172,8 @@ function getWindowDimmer(actor) {
|
||||
*/
|
||||
var LAST_WINDOW_GRACE_TIME = 1000;
|
||||
|
||||
var WorkspaceTracker = new Lang.Class({
|
||||
Name: 'WorkspaceTracker',
|
||||
|
||||
_init(wm) {
|
||||
var WorkspaceTracker = class {
|
||||
constructor(wm) {
|
||||
this._wm = wm;
|
||||
|
||||
this._workspaces = [];
|
||||
@ -208,15 +201,15 @@ var WorkspaceTracker = new Lang.Class({
|
||||
this._workspaceSettings.connect('changed::dynamic-workspaces', this._queueCheckWorkspaces.bind(this));
|
||||
|
||||
this._nWorkspacesChanged();
|
||||
},
|
||||
}
|
||||
|
||||
blockUpdates() {
|
||||
this._pauseWorkspaceCheck = true;
|
||||
},
|
||||
}
|
||||
|
||||
unblockUpdates() {
|
||||
this._pauseWorkspaceCheck = false;
|
||||
},
|
||||
}
|
||||
|
||||
_checkWorkspaces() {
|
||||
let workspaceManager = global.workspace_manager;
|
||||
@ -283,7 +276,7 @@ var WorkspaceTracker = new Lang.Class({
|
||||
|
||||
this._checkWorkspacesId = 0;
|
||||
return false;
|
||||
},
|
||||
}
|
||||
|
||||
keepWorkspaceAlive(workspace, duration) {
|
||||
if (workspace._keepAliveId)
|
||||
@ -295,7 +288,7 @@ var WorkspaceTracker = new Lang.Class({
|
||||
return GLib.SOURCE_REMOVE;
|
||||
});
|
||||
GLib.Source.set_name_by_id(workspace._keepAliveId, '[gnome-shell] this._queueCheckWorkspaces');
|
||||
},
|
||||
}
|
||||
|
||||
_windowRemoved(workspace, window) {
|
||||
workspace._lastRemovedWindow = window;
|
||||
@ -308,33 +301,33 @@ var WorkspaceTracker = new Lang.Class({
|
||||
return GLib.SOURCE_REMOVE;
|
||||
});
|
||||
GLib.Source.set_name_by_id(id, '[gnome-shell] this._queueCheckWorkspaces');
|
||||
},
|
||||
}
|
||||
|
||||
_windowLeftMonitor(metaDisplay, monitorIndex, metaWin) {
|
||||
// If the window left the primary monitor, that
|
||||
// might make that workspace empty
|
||||
if (monitorIndex == Main.layoutManager.primaryIndex)
|
||||
this._queueCheckWorkspaces();
|
||||
},
|
||||
}
|
||||
|
||||
_windowEnteredMonitor(metaDisplay, monitorIndex, metaWin) {
|
||||
// If the window entered the primary monitor, that
|
||||
// might make that workspace non-empty
|
||||
if (monitorIndex == Main.layoutManager.primaryIndex)
|
||||
this._queueCheckWorkspaces();
|
||||
},
|
||||
}
|
||||
|
||||
_windowsRestacked() {
|
||||
// Figure out where the pointer is in case we lost track of
|
||||
// it during a grab. (In particular, if a trayicon popup menu
|
||||
// is dismissed, see if we need to close the message tray.)
|
||||
global.sync_pointer();
|
||||
},
|
||||
}
|
||||
|
||||
_queueCheckWorkspaces() {
|
||||
if (this._checkWorkspacesId == 0)
|
||||
this._checkWorkspacesId = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, this._checkWorkspaces.bind(this));
|
||||
},
|
||||
}
|
||||
|
||||
_nWorkspacesChanged() {
|
||||
let workspaceManager = global.workspace_manager;
|
||||
@ -382,18 +375,16 @@ var WorkspaceTracker = new Lang.Class({
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var TilePreview = new Lang.Class({
|
||||
Name: 'TilePreview',
|
||||
|
||||
_init() {
|
||||
var TilePreview = class {
|
||||
constructor() {
|
||||
this.actor = new St.Widget();
|
||||
global.window_group.add_actor(this.actor);
|
||||
|
||||
this._reset();
|
||||
this._showing = false;
|
||||
},
|
||||
}
|
||||
|
||||
show(window, tileRect, monitorIndex) {
|
||||
let windowActor = window.get_compositor_private();
|
||||
@ -437,7 +428,7 @@ var TilePreview = new Lang.Class({
|
||||
time: WINDOW_ANIMATION_TIME,
|
||||
transition: 'easeOutQuad'
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
hide() {
|
||||
if (!this._showing)
|
||||
@ -450,13 +441,13 @@ var TilePreview = new Lang.Class({
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: this._reset.bind(this)
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
_reset() {
|
||||
this.actor.hide();
|
||||
this._rect = null;
|
||||
this._monitorIndex = -1;
|
||||
},
|
||||
}
|
||||
|
||||
_updateStyle(monitor) {
|
||||
let styles = ['tile-preview'];
|
||||
@ -469,17 +460,15 @@ var TilePreview = new Lang.Class({
|
||||
|
||||
this.actor.style_class = styles.join(' ');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var TouchpadWorkspaceSwitchAction = new Lang.Class({
|
||||
Name: 'TouchpadWorkspaceSwitchAction',
|
||||
|
||||
_init(actor) {
|
||||
var TouchpadWorkspaceSwitchAction = class {
|
||||
constructor(actor) {
|
||||
this._dx = 0;
|
||||
this._dy = 0;
|
||||
actor.connect('captured-event', this._handleEvent.bind(this));
|
||||
this._touchpadSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.peripherals.touchpad'});
|
||||
},
|
||||
}
|
||||
|
||||
_checkActivated() {
|
||||
let dir;
|
||||
@ -497,7 +486,7 @@ var TouchpadWorkspaceSwitchAction = new Lang.Class({
|
||||
|
||||
this.emit('activated', dir);
|
||||
return true;
|
||||
},
|
||||
}
|
||||
|
||||
_handleEvent(actor, event) {
|
||||
let allowedModes = Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW;
|
||||
@ -533,7 +522,7 @@ var TouchpadWorkspaceSwitchAction = new Lang.Class({
|
||||
|
||||
return Clutter.EVENT_STOP;
|
||||
}
|
||||
});
|
||||
};
|
||||
Signals.addSignalMethods(TouchpadWorkspaceSwitchAction.prototype);
|
||||
|
||||
var WorkspaceSwitchAction = new Lang.Class({
|
||||
@ -667,10 +656,8 @@ var AppSwitchAction = new Lang.Class({
|
||||
}
|
||||
});
|
||||
|
||||
var ResizePopup = new Lang.Class({
|
||||
Name: 'ResizePopup',
|
||||
|
||||
_init() {
|
||||
var ResizePopup = class {
|
||||
constructor() {
|
||||
this._widget = new St.Widget({ layout_manager: new Clutter.BinLayout() });
|
||||
this._label = new St.Label({ style_class: 'resize-popup',
|
||||
x_align: Clutter.ActorAlign.CENTER,
|
||||
@ -678,7 +665,7 @@ var ResizePopup = new Lang.Class({
|
||||
x_expand: true, y_expand: true });
|
||||
this._widget.add_child(this._label);
|
||||
Main.uiGroup.add_actor(this._widget);
|
||||
},
|
||||
}
|
||||
|
||||
set(rect, displayW, displayH) {
|
||||
/* Translators: This represents the size of a window. The first number is
|
||||
@ -688,18 +675,16 @@ var ResizePopup = new Lang.Class({
|
||||
|
||||
this._widget.set_position(rect.x, rect.y);
|
||||
this._widget.set_size(rect.width, rect.height);
|
||||
},
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this._widget.destroy();
|
||||
this._widget = null;
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var WindowManager = new Lang.Class({
|
||||
Name: 'WindowManager',
|
||||
|
||||
_init() {
|
||||
var WindowManager = class {
|
||||
constructor() {
|
||||
this._shellwm = global.window_manager;
|
||||
|
||||
this._minimizing = [];
|
||||
@ -1036,14 +1021,14 @@ var WindowManager = new Lang.Class({
|
||||
currentWindow.unmake_fullscreen();
|
||||
});
|
||||
global.stage.add_action(gesture);
|
||||
},
|
||||
}
|
||||
|
||||
_showPadOsd(display, device, settings, imagePath, editionMode, monitorIndex) {
|
||||
this._currentPadOsd = new PadOsd.PadOsd(device, settings, imagePath, editionMode, monitorIndex);
|
||||
this._currentPadOsd.connect('closed', () => { this._currentPadOsd = null });
|
||||
|
||||
return this._currentPadOsd.actor;
|
||||
},
|
||||
}
|
||||
|
||||
_switchWorkspaceMotion(action, xRel, yRel) {
|
||||
let workspaceManager = global.workspace_manager;
|
||||
@ -1062,7 +1047,7 @@ var WindowManager = new Lang.Class({
|
||||
xRel = 0;
|
||||
|
||||
this._switchData.container.set_position(xRel, yRel);
|
||||
},
|
||||
}
|
||||
|
||||
_switchWorkspaceCancel() {
|
||||
if (!this._switchData || this._switchData.inProgress)
|
||||
@ -1078,7 +1063,7 @@ var WindowManager = new Lang.Class({
|
||||
onCompleteScope: this,
|
||||
onCompleteParams: [switchData],
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
_actionSwitchWorkspace(action, direction) {
|
||||
let workspaceManager = global.workspace_manager;
|
||||
@ -1091,7 +1076,7 @@ var WindowManager = new Lang.Class({
|
||||
this._switchData.gestureActivated = true;
|
||||
this.actionMoveWorkspace(newWs);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_lookupIndex(windows, metaWindow) {
|
||||
for (let i = 0; i < windows.length; i++) {
|
||||
@ -1100,7 +1085,7 @@ var WindowManager = new Lang.Class({
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
},
|
||||
}
|
||||
|
||||
_switchApp() {
|
||||
let windows = global.get_window_actors().filter(actor => {
|
||||
@ -1129,7 +1114,7 @@ var WindowManager = new Lang.Class({
|
||||
}
|
||||
|
||||
Main.activateWindow(nextWindow);
|
||||
},
|
||||
}
|
||||
|
||||
insertWorkspace(pos) {
|
||||
let workspaceManager = global.workspace_manager;
|
||||
@ -1168,44 +1153,43 @@ var WindowManager = new Lang.Class({
|
||||
newWs.activate(global.get_current_time());
|
||||
this._blockAnimations = false;
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
keepWorkspaceAlive(workspace, duration) {
|
||||
if (!this._workspaceTracker)
|
||||
return;
|
||||
|
||||
this._workspaceTracker.keepWorkspaceAlive(workspace, duration);
|
||||
},
|
||||
}
|
||||
|
||||
skipNextEffect(actor) {
|
||||
this._skippedActors.push(actor);
|
||||
},
|
||||
}
|
||||
|
||||
setCustomKeybindingHandler(name, modes, handler) {
|
||||
if (Meta.keybindings_set_custom_handler(name, handler))
|
||||
this.allowKeybinding(name, modes);
|
||||
},
|
||||
}
|
||||
|
||||
addKeybinding(name, settings, flags, modes, handler) {
|
||||
let action = global.display.add_keybinding(name, settings, flags, handler);
|
||||
if (action != Meta.KeyBindingAction.NONE)
|
||||
this.allowKeybinding(name, modes);
|
||||
return action;
|
||||
},
|
||||
}
|
||||
|
||||
removeKeybinding(name) {
|
||||
if (global.display.remove_keybinding(name))
|
||||
this.allowKeybinding(name, Shell.ActionMode.NONE);
|
||||
},
|
||||
}
|
||||
|
||||
allowKeybinding(name, modes) {
|
||||
this._allowedKeybindings[name] = modes;
|
||||
},
|
||||
}
|
||||
|
||||
_shouldAnimate() {
|
||||
return !(Main.overview.visible || this._blockAnimations);
|
||||
},
|
||||
}
|
||||
|
||||
_shouldAnimateActor(actor, types) {
|
||||
if (this._removeEffect(this._skippedActors, actor))
|
||||
@ -1219,7 +1203,7 @@ var WindowManager = new Lang.Class({
|
||||
|
||||
let type = actor.meta_window.get_window_type();
|
||||
return types.indexOf(type) >= 0;
|
||||
},
|
||||
}
|
||||
|
||||
_removeEffect(list, actor) {
|
||||
let idx = list.indexOf(actor);
|
||||
@ -1228,7 +1212,7 @@ var WindowManager = new Lang.Class({
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
|
||||
_minimizeWindow(shellwm, actor) {
|
||||
let types = [Meta.WindowType.NORMAL,
|
||||
@ -1292,7 +1276,7 @@ var WindowManager = new Lang.Class({
|
||||
onOverwriteParams: [shellwm, actor]
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_minimizeWindowDone(shellwm, actor) {
|
||||
if (this._removeEffect(this._minimizing, actor)) {
|
||||
@ -1303,13 +1287,13 @@ var WindowManager = new Lang.Class({
|
||||
|
||||
shellwm.completed_minimize(actor);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_minimizeWindowOverwritten(shellwm, actor) {
|
||||
if (this._removeEffect(this._minimizing, actor)) {
|
||||
shellwm.completed_minimize(actor);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_unminimizeWindow(shellwm, actor) {
|
||||
let types = [Meta.WindowType.NORMAL,
|
||||
@ -1374,7 +1358,7 @@ var WindowManager = new Lang.Class({
|
||||
onOverwriteParams: [shellwm, actor]
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_unminimizeWindowDone(shellwm, actor) {
|
||||
if (this._removeEffect(this._unminimizing, actor)) {
|
||||
@ -1385,13 +1369,13 @@ var WindowManager = new Lang.Class({
|
||||
|
||||
shellwm.completed_unminimize(actor);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_unminimizeWindowOverwritten(shellwm, actor) {
|
||||
if (this._removeEffect(this._unminimizing, actor)) {
|
||||
shellwm.completed_unminimize(actor);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_sizeChangeWindow(shellwm, actor, whichChange, oldFrameRect, oldBufferRect) {
|
||||
let types = [Meta.WindowType.NORMAL];
|
||||
@ -1404,7 +1388,7 @@ var WindowManager = new Lang.Class({
|
||||
this._prepareAnimationInfo(shellwm, actor, oldFrameRect, whichChange);
|
||||
else
|
||||
shellwm.completed_size_change(actor);
|
||||
},
|
||||
}
|
||||
|
||||
_prepareAnimationInfo(shellwm, actor, oldFrameRect, change) {
|
||||
// Position a clone of the window on top of the old position,
|
||||
@ -1421,7 +1405,7 @@ var WindowManager = new Lang.Class({
|
||||
|
||||
actor.__animationInfo = { clone: actorClone,
|
||||
oldRect: oldFrameRect };
|
||||
},
|
||||
}
|
||||
|
||||
_sizeChangedWindow(shellwm, actor) {
|
||||
if (!actor.__animationInfo)
|
||||
@ -1476,7 +1460,7 @@ var WindowManager = new Lang.Class({
|
||||
// It's important that we don't wait until the animation is completed to
|
||||
// do this, otherwise our scale will be applied to the old texture size.
|
||||
shellwm.completed_size_change(actor);
|
||||
},
|
||||
}
|
||||
|
||||
_clearAnimationInfo(actor) {
|
||||
if (actor.__animationInfo) {
|
||||
@ -1485,7 +1469,7 @@ var WindowManager = new Lang.Class({
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
|
||||
_sizeChangeWindowDone(shellwm, actor) {
|
||||
if (this._removeEffect(this._resizing, actor)) {
|
||||
@ -1496,12 +1480,12 @@ var WindowManager = new Lang.Class({
|
||||
actor.translation_y = 0;
|
||||
this._clearAnimationInfo(actor);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_sizeChangeWindowOverwritten(shellwm, actor) {
|
||||
if (this._removeEffect(this._resizing, actor))
|
||||
this._clearAnimationInfo(actor);
|
||||
},
|
||||
}
|
||||
|
||||
_hasAttachedDialogs(window, ignoreWindow) {
|
||||
var count = 0;
|
||||
@ -1515,7 +1499,7 @@ var WindowManager = new Lang.Class({
|
||||
return true;
|
||||
});
|
||||
return count != 0;
|
||||
},
|
||||
}
|
||||
|
||||
_checkDimming(window, ignoreWindow) {
|
||||
let shouldDim = this._hasAttachedDialogs(window, ignoreWindow);
|
||||
@ -1530,7 +1514,7 @@ var WindowManager = new Lang.Class({
|
||||
this._dimmedWindows.filter(win => win != window);
|
||||
this._undimWindow(window);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_dimWindow(window) {
|
||||
let actor = window.get_compositor_private();
|
||||
@ -1547,7 +1531,7 @@ var WindowManager = new Lang.Class({
|
||||
});
|
||||
else
|
||||
dimmer.dimFactor = 1.0;
|
||||
},
|
||||
}
|
||||
|
||||
_undimWindow(window) {
|
||||
let actor = window.get_compositor_private();
|
||||
@ -1563,7 +1547,7 @@ var WindowManager = new Lang.Class({
|
||||
transition: 'linear' });
|
||||
else
|
||||
dimmer.dimFactor = 0.0;
|
||||
},
|
||||
}
|
||||
|
||||
_mapWindow(shellwm, actor) {
|
||||
actor._windowType = actor.meta_window.get_window_type();
|
||||
@ -1647,7 +1631,7 @@ var WindowManager = new Lang.Class({
|
||||
shellwm.completed_map(actor);
|
||||
return;
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_mapWindowDone(shellwm, actor) {
|
||||
if (this._removeEffect(this._mapping, actor)) {
|
||||
@ -1660,13 +1644,13 @@ var WindowManager = new Lang.Class({
|
||||
actor.translation_x = 0;
|
||||
shellwm.completed_map(actor);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_mapWindowOverwrite(shellwm, actor) {
|
||||
if (this._removeEffect(this._mapping, actor)) {
|
||||
shellwm.completed_map(actor);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_destroyWindow(shellwm, actor) {
|
||||
let window = actor.meta_window;
|
||||
@ -1738,7 +1722,7 @@ var WindowManager = new Lang.Class({
|
||||
shellwm.completed_destroy(actor);
|
||||
return;
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_destroyWindowDone(shellwm, actor) {
|
||||
if (this._removeEffect(this._destroying, actor)) {
|
||||
@ -1749,7 +1733,7 @@ var WindowManager = new Lang.Class({
|
||||
}
|
||||
shellwm.completed_destroy(actor);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_filterKeybinding(shellwm, binding) {
|
||||
if (Main.actionMode == Shell.ActionMode.NONE)
|
||||
@ -1764,7 +1748,7 @@ var WindowManager = new Lang.Class({
|
||||
return false;
|
||||
|
||||
return !(this._allowedKeybindings[binding.get_name()] & Main.actionMode);
|
||||
},
|
||||
}
|
||||
|
||||
_syncStacking() {
|
||||
if (this._switchData == null)
|
||||
@ -1793,7 +1777,7 @@ var WindowManager = new Lang.Class({
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_getPositionForDirection(direction) {
|
||||
let xDest = 0, yDest = 0;
|
||||
@ -1817,7 +1801,7 @@ var WindowManager = new Lang.Class({
|
||||
xDest = global.screen_width;
|
||||
|
||||
return [xDest, yDest];
|
||||
},
|
||||
}
|
||||
|
||||
_prepareWorkspaceSwitch(from, to, direction) {
|
||||
if (this._switchData)
|
||||
@ -1914,7 +1898,7 @@ var WindowManager = new Lang.Class({
|
||||
switchData.windows.splice(switchData.windows.indexOf(w), 1);
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_finishWorkspaceSwitch(switchData) {
|
||||
this._switchData = null;
|
||||
@ -1934,7 +1918,7 @@ var WindowManager = new Lang.Class({
|
||||
switchData.movingWindowBin.destroy();
|
||||
|
||||
this._movingWindow = null;
|
||||
},
|
||||
}
|
||||
|
||||
_switchWorkspace(shellwm, from, to, direction) {
|
||||
if (!Main.sessionMode.hasWorkspaces || !this._shouldAnimate()) {
|
||||
@ -1967,28 +1951,28 @@ var WindowManager = new Lang.Class({
|
||||
onCompleteScope: this,
|
||||
onCompleteParams: [shellwm]
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
_switchWorkspaceDone(shellwm) {
|
||||
this._finishWorkspaceSwitch(this._switchData);
|
||||
shellwm.completed_switch_workspace();
|
||||
},
|
||||
}
|
||||
|
||||
_showTilePreview(shellwm, window, tileRect, monitorIndex) {
|
||||
if (!this._tilePreview)
|
||||
this._tilePreview = new TilePreview();
|
||||
this._tilePreview.show(window, tileRect, monitorIndex);
|
||||
},
|
||||
}
|
||||
|
||||
_hideTilePreview(shellwm) {
|
||||
if (!this._tilePreview)
|
||||
return;
|
||||
this._tilePreview.hide();
|
||||
},
|
||||
}
|
||||
|
||||
_showWindowMenu(shellwm, window, menu, rect) {
|
||||
this._windowMenuManager.showWindowMenuForWindow(window, menu, rect);
|
||||
},
|
||||
}
|
||||
|
||||
_startSwitcher(display, window, binding) {
|
||||
let constructor = null;
|
||||
@ -2027,19 +2011,19 @@ var WindowManager = new Lang.Class({
|
||||
|
||||
if (!tabPopup.show(binding.is_reversed(), binding.get_name(), binding.get_mask()))
|
||||
tabPopup.destroy();
|
||||
},
|
||||
}
|
||||
|
||||
_startA11ySwitcher(display, window, binding) {
|
||||
Main.ctrlAltTabManager.popup(binding.is_reversed(), binding.get_name(), binding.get_mask());
|
||||
},
|
||||
}
|
||||
|
||||
_toggleAppMenu(display, window, event, binding) {
|
||||
Main.panel.toggleAppMenu();
|
||||
},
|
||||
}
|
||||
|
||||
_toggleCalendar(display, window, event, binding) {
|
||||
Main.panel.toggleCalendar();
|
||||
},
|
||||
}
|
||||
|
||||
_toggleTweens() {
|
||||
this._tweensPaused = !this._tweensPaused;
|
||||
@ -2048,7 +2032,7 @@ var WindowManager = new Lang.Class({
|
||||
OrigTweener.pauseAllTweens();
|
||||
else
|
||||
OrigTweener.resumeAllTweens();
|
||||
},
|
||||
}
|
||||
|
||||
_showWorkspaceSwitcher(display, window, binding) {
|
||||
let workspaceManager = display.get_workspace_manager();
|
||||
@ -2117,7 +2101,7 @@ var WindowManager = new Lang.Class({
|
||||
}
|
||||
this._workspaceSwitcherPopup.display(direction, newWs.index());
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
actionMoveWorkspace(workspace) {
|
||||
if (!Main.sessionMode.hasWorkspaces)
|
||||
@ -2128,7 +2112,7 @@ var WindowManager = new Lang.Class({
|
||||
|
||||
if (activeWorkspace != workspace)
|
||||
workspace.activate(global.get_current_time());
|
||||
},
|
||||
}
|
||||
|
||||
actionMoveWindow(window, workspace) {
|
||||
if (!Main.sessionMode.hasWorkspaces)
|
||||
@ -2147,20 +2131,20 @@ var WindowManager = new Lang.Class({
|
||||
global.display.clear_mouse_mode();
|
||||
workspace.activate_with_focus (window, global.get_current_time());
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
_confirmDisplayChange() {
|
||||
let dialog = new DisplayChangeDialog(this._shellwm);
|
||||
dialog.open();
|
||||
},
|
||||
}
|
||||
|
||||
_createCloseDialog(shellwm, window) {
|
||||
return new CloseDialog.CloseDialog(window);
|
||||
},
|
||||
}
|
||||
|
||||
_createInhibitShortcutsDialog(shellwm, window) {
|
||||
return new InhibitShortcutsDialog.InhibitShortcutsDialog(window);
|
||||
},
|
||||
}
|
||||
|
||||
_showResizePopup(display, show, rect, displayW, displayH) {
|
||||
if (show) {
|
||||
@ -2174,5 +2158,5 @@ var WindowManager = new Lang.Class({
|
||||
this._resizePopup = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user