Revert "windowManager: Block dynamic workspace updates while showing the popup"

This reverts commit aeb971c33a.

https://bugzilla.gnome.org/show_bug.cgi?id=720885
This commit is contained in:
Adel Gadllah 2015-03-27 14:32:06 +01:00
parent aeb971c33a
commit 5e26d0c90c

View File

@ -197,8 +197,6 @@ const WorkspaceTracker = new Lang.Class({
this._workspaces = []; this._workspaces = [];
this._checkWorkspacesId = 0; this._checkWorkspacesId = 0;
this._pauseWorkspaceCheck = false;
let tracker = Shell.WindowTracker.get_default(); let tracker = Shell.WindowTracker.get_default();
tracker.connect('startup-sequence-changed', Lang.bind(this, this._queueCheckWorkspaces)); tracker.connect('startup-sequence-changed', Lang.bind(this, this._queueCheckWorkspaces));
@ -222,14 +220,6 @@ const WorkspaceTracker = new Lang.Class({
return new Gio.Settings({ schema_id: 'org.gnome.mutter' }); return new Gio.Settings({ schema_id: 'org.gnome.mutter' });
}, },
blockUpdates: function() {
this._pauseWorkspaceCheck = true;
},
unblockUpdates: function() {
this._pauseWorkspaceCheck = false;
},
_checkWorkspaces: function() { _checkWorkspaces: function() {
let i; let i;
let emptyWorkspaces = []; let emptyWorkspaces = [];
@ -239,10 +229,6 @@ const WorkspaceTracker = new Lang.Class({
return false; return false;
} }
// Update workspaces only if Dynamic Workspace Management has not been paused by some other function
if (this._pauseWorkspaceCheck)
return true;
for (i = 0; i < this._workspaces.length; i++) { for (i = 0; i < this._workspaces.length; i++) {
let lastRemoved = this._workspaces[i]._lastRemovedWindow; let lastRemoved = this._workspaces[i]._lastRemovedWindow;
if ((lastRemoved && if ((lastRemoved &&
@ -641,8 +627,6 @@ const WindowManager = new Lang.Class({
this._allowedKeybindings = {}; this._allowedKeybindings = {};
this._isWorkspacePrepended = false;
this._switchData = null; this._switchData = null;
this._shellwm.connect('kill-switch-workspace', Lang.bind(this, this._switchWorkspaceDone)); this._shellwm.connect('kill-switch-workspace', Lang.bind(this, this._switchWorkspaceDone));
this._shellwm.connect('kill-window-effects', Lang.bind(this, function (shellwm, actor) { this._shellwm.connect('kill-window-effects', Lang.bind(this, function (shellwm, actor) {
@ -931,8 +915,6 @@ const WindowManager = new Lang.Class({
if (!Meta.prefs_get_dynamic_workspaces()) if (!Meta.prefs_get_dynamic_workspaces())
return; return;
global.screen.append_new_workspace(false, global.get_current_time());
let windows = global.get_window_actors().map(function(winActor) { let windows = global.get_window_actors().map(function(winActor) {
return winActor.meta_window; return winActor.meta_window;
}); });
@ -1660,10 +1642,8 @@ const WindowManager = new Lang.Class({
} else if (isNaN(target)) { } else if (isNaN(target)) {
// Prepend a new workspace dynamically // Prepend a new workspace dynamically
if (screen.get_active_workspace_index() == 0 && if (screen.get_active_workspace_index() == 0 &&
action == 'move' && target == 'up' && this._isWorkspacePrepended == false) { action == 'move' && target == 'up')
this.insertWorkspace(0); this.insertWorkspace(0);
this._isWorkspacePrepended = true;
}
direction = Meta.MotionDirection[target.toUpperCase()]; direction = Meta.MotionDirection[target.toUpperCase()];
newWs = screen.get_active_workspace().get_neighbor(direction); newWs = screen.get_active_workspace().get_neighbor(direction);
@ -1688,12 +1668,9 @@ const WindowManager = new Lang.Class({
if (!Main.overview.visible) { if (!Main.overview.visible) {
if (this._workspaceSwitcherPopup == null) { if (this._workspaceSwitcherPopup == null) {
this._workspaceTracker.blockUpdates();
this._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup(); this._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup();
this._workspaceSwitcherPopup.connect('destroy', Lang.bind(this, function() { this._workspaceSwitcherPopup.connect('destroy', Lang.bind(this, function() {
this._workspaceTracker.unblockUpdates();
this._workspaceSwitcherPopup = null; this._workspaceSwitcherPopup = null;
this._isWorkspacePrepended = false;
})); }));
} }
this._workspaceSwitcherPopup.display(direction, newWs.index()); this._workspaceSwitcherPopup.display(direction, newWs.index());