[gnome-shell-extensions] various: update the extensions for gnome-shell API changes



commit c256ed802bed3e1eb5dca0ba8b534f7774c5da6d
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Mon Oct 3 17:31:43 2011 +0100

    various: update the extensions for gnome-shell API changes
    
    GNOME Shell has changed internal API here and there, and this
    broke some extensions.
    alternate-tab and dock still have issues, I'll try to solve them
    post 3.2.0

 extensions/alternate-tab/extension.js           |   12 ++++++------
 extensions/alternative-status-menu/extension.js |    4 ++--
 extensions/dock/extension.js                    |    9 +++------
 extensions/workspace-indicator/extension.js     |    7 +++++--
 4 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/extensions/alternate-tab/extension.js b/extensions/alternate-tab/extension.js
index ce44965..c872f5c 100644
--- a/extensions/alternate-tab/extension.js
+++ b/extensions/alternate-tab/extension.js
@@ -69,8 +69,8 @@ AltTabPopupW.prototype = {
     __proto__ : AltTab.AltTabPopup.prototype,
 
     show : function(backward, switch_group) {
-        let tracker = Shell.WindowTracker.get_default();
-        let apps = tracker.get_running_apps ('');
+        let appSys = Shell.AppSystem.get_default();
+        let apps = appSys.get_running ();
 
         if (!apps.length)
             return false;
@@ -358,8 +358,8 @@ AltTabPopup2.prototype = {
 	let list = '';
 	let normal_windows= [];
 	let appIcons = [];
-	let tracker = Shell.WindowTracker.get_default();
-	let apps = tracker.get_running_apps ('');
+	let appSys = Shell.AppSystem.get_default();
+	let apps = appSys.get_running();
 
 	for (let w = windows.length-1; w >= 0; w--) {
 	    let win = windows[w].get_meta_window();
@@ -507,8 +507,8 @@ WindowList.prototype = {
 
 	    let win=windows[w];
 
-	    let tracker = Shell.WindowTracker.get_default();
-	    let apps = tracker.get_running_apps ('');
+	    let appSys = Shell.AppSystem.get_default();
+	    let apps = appSys.get_running();
 	    let ap1 = null;
 	    for (let i = 0; i < apps.length; i++) {
 	        let app_wins = apps[i].get_windows();
diff --git a/extensions/alternative-status-menu/extension.js b/extensions/alternative-status-menu/extension.js
index df67519..3e542ef 100644
--- a/extensions/alternative-status-menu/extension.js
+++ b/extensions/alternative-status-menu/extension.js
@@ -114,7 +114,7 @@ function reset(statusMenu) {
 }
 
 function enable() {
-    let statusMenu = Main.panel._userMenu;
+    let statusMenu = Main.panel._statusArea.userMenu;
     statusMenu.menu.removeAll();
     createSubMenu.call(statusMenu);
     reset(statusMenu);
@@ -122,7 +122,7 @@ function enable() {
 
 function disable() {
     // not guarranteed to work, if more extensions operate in the same place
-    let statusMenu = Main.panel._userMenu;
+    let statusMenu = Main.panel._statusArea.userMenu;
     statusMenu.menu.removeAll();
     statusMenu._createSubMenu();
     reset(statusMenu);
diff --git a/extensions/dock/extension.js b/extensions/dock/extension.js
index bb5338c..47cd76f 100644
--- a/extensions/dock/extension.js
+++ b/extensions/dock/extension.js
@@ -295,7 +295,7 @@ Dock.prototype = {
 
         this._installedChangedId = this._appSystem.connect('installed-changed', Lang.bind(this, this._queueRedisplay));
         this._appFavoritesChangedId = AppFavorites.getAppFavorites().connect('changed', Lang.bind(this, this._queueRedisplay));
-        this._appStateChangedId = this._tracker.connect('app-state-changed', Lang.bind(this, this._queueRedisplay));
+        this._appStateChangedId = this._appSystem.connect('app-state-changed', Lang.bind(this, this._queueRedisplay));
 
         this._overviewShowingId = Main.overview.connect('showing', Lang.bind(this, function() {
             this.actor.hide();
@@ -386,7 +386,7 @@ Dock.prototype = {
         }
 
         if (this._appStateChangedId) {
-            this._tracker.disconnect(this._appStateChangedId);
+            this._appSystem.disconnect(this._appStateChangedId);
             this._appStateChangedId = 0;
         }
 
@@ -450,10 +450,7 @@ Dock.prototype = {
 
         let favorites = AppFavorites.getAppFavorites().getFavoriteMap();
 
-        /* hardcode here pending some design about how exactly desktop contexts behave */
-        let contextId = '';
-
-        let running = this._tracker.get_running_apps(contextId);
+        let running = this._appSystem.get_running();
         let runningIds = this._appIdListToHash(running);
 
         let icons = 0;
diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js
index f2c6749..7f5ca46 100644
--- a/extensions/workspace-indicator/extension.js
+++ b/extensions/workspace-indicator/extension.js
@@ -21,7 +21,10 @@ WorkspaceIndicator.prototype = {
 
 	        this._currentWorkspace = global.screen.get_active_workspace().index();
 		this.statusLabel = new St.Label({ text: this._labelText() });
-		this.actor.set_child(this.statusLabel);
+
+	        // destroy all previously created children, and add our statusLabel
+ 	        this.actor.get_children().forEach(function(c) { c.destroy() });
+		this.actor.add_actor(this.statusLabel);
 
 		this.workspacesItems = [];
 		this._workspaceSection = new PopupMenu.PopupMenuSection();
@@ -94,7 +97,7 @@ WorkspaceIndicator.prototype = {
 }
 
 function init(meta) {
-    Panel.STANDARD_TRAY_ICON_ORDER.unshift('workspace-indicator');
+    // empty
 }
 
 let _indicator;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]