[gnome-shell-extensions] WindowsNavigator: fix with recent shell
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] WindowsNavigator: fix with recent shell
- Date: Tue, 20 Nov 2012 15:47:37 +0000 (UTC)
commit 9d9ef27317c19f6d168c8bfd42038205fc18aed7
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Tue Nov 20 16:22:45 2012 +0100
WindowsNavigator: fix with recent shell
Recently WindowsNavigator would just crash the shell upon entering
the overview. I'm not sure where the bug was, probably it was due to
the new window layout code.
extensions/windowsNavigator/extension.js | 47 ++++--------------------------
1 files changed, 6 insertions(+), 41 deletions(-)
---
diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js
index a825653..0c54244 100644
--- a/extensions/windowsNavigator/extension.js
+++ b/extensions/windowsNavigator/extension.js
@@ -33,26 +33,10 @@ function resetState() {
function enable() {
resetState();
- Workspace.WindowOverlay.prototype.setId = function(id) {
- if (this._text && this._text.visible && id == null)
- this._text.hide();
- this._id = id;
- if (id != null)
- this._text.text = this._id.toString();
- }
- winInjections['setId'] = undefined;
-
- Workspace.WindowOverlay.prototype.getId = function() {
- return this._id;
- }
- winInjections['getId'] = undefined;
-
Workspace.WindowOverlay.prototype.showTooltip = function() {
- if (this._id === null)
- return;
this._text.raise_top();
this._text.show();
- this._text.text = this._id.toString();
+ this._text.text = (this._windowClone.slotId + 1).toString();
}
winInjections['showTooltip'] = undefined;
@@ -83,11 +67,9 @@ function enable() {
workspaceInjections['hideTooltip'] = undefined;
Workspace.Workspace.prototype.getWindowWithTooltip = function(id) {
- for (let i in this._windowOverlays) {
- if (this._windowOverlays[i] == null)
- continue;
- if (this._windowOverlays[i].getId() === id)
- return this._windowOverlays[i]._windowClone.metaWindow;
+ for (let i = 0; i < this._windows.length; i++) {
+ if ((this._windows[i].slotId + 1) == id)
+ return this._windows[i].metaWindow;
}
return null;
}
@@ -127,11 +109,11 @@ function enable() {
workViewInjections['_hideWorkspacesTooltips'] = undefined;
WorkspacesView.WorkspacesView.prototype._onKeyRelease = function(s, o) {
- if (this._pickWindow &&
+ if (this._pickWindow &&
(o.get_key_symbol() == Clutter.KEY_Alt_L ||
o.get_key_symbol() == Clutter.KEY_Alt_R))
this._hideTooltips();
- if (this._pickWorkspace &&
+ if (this._pickWorkspace &&
(o.get_key_symbol() == Clutter.KEY_Control_L ||
o.get_key_symbol() == Clutter.KEY_Control_R))
this._hideWorkspacesTooltips();
@@ -245,23 +227,6 @@ function enable() {
this._tip = null;
});
- workspaceInjections['positionWindows'] = injectToFunction(Workspace.Workspace.prototype, 'positionWindows', function(flags) {
- let visibleClones = this._windows.slice();
- if (this._reservedSlot)
- visibleClones.push(this._reservedSlot);
-
- let slots = this._computeAllWindowSlots(visibleClones.length);
- visibleClones = this._orderWindowsByMotionAndStartup(visibleClones, slots);
- for (let i = 0; i < visibleClones.length; i++) {
- let clone = visibleClones[i];
- let metaWindow = clone.metaWindow;
- let mainIndex = this._lookupIndex(metaWindow);
- let overlay = this._windowOverlays[mainIndex];
- if (overlay)
- overlay.setId(i < 9 ? i + 1 : null);
- }
- });
-
workViewInjections['_init'] = injectToFunction(WorkspacesView.WorkspacesView.prototype, '_init', function(width, height, x, y, workspaces) {
this._pickWorkspace = false;
this._pickWindow = false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]