[gnome-shell] js: Use SOURCE_CONTINUE/SOURCE_REMOVE constants in source functions



commit 751a3f0e946953784de3e9c32aea47e4550aa409
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Nov 29 01:45:39 2013 +0100

    js: Use SOURCE_CONTINUE/SOURCE_REMOVE constants in source functions
    
    With support for boolean constants in g-i, we can finally use the
    more readable constants instead of true/false.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719567

 js/gdm/loginDialog.js                |    3 ++-
 js/gdm/util.js                       |    1 +
 js/ui/altTab.js                      |    5 +++--
 js/ui/animation.js                   |    3 ++-
 js/ui/appDisplay.js                  |    2 +-
 js/ui/background.js                  |    6 ++++--
 js/ui/components/automountManager.js |    4 ++--
 js/ui/components/telepathyClient.js  |    6 +++---
 js/ui/dash.js                        |    5 +++--
 js/ui/dnd.js                         |    6 +++---
 js/ui/endSessionDialog.js            |    4 ++--
 js/ui/keyboard.js                    |    7 ++++++-
 js/ui/layout.js                      |    4 ++--
 js/ui/lookingGlass.js                |    1 +
 js/ui/main.js                        |    2 +-
 js/ui/messageTray.js                 |   12 ++++++------
 js/ui/notificationDaemon.js          |    2 +-
 js/ui/osdWindow.js                   |    2 ++
 js/ui/overview.js                    |    3 ++-
 js/ui/panel.js                       |    1 +
 js/ui/pointerWatcher.js              |    3 ++-
 js/ui/screenShield.js                |    5 +++--
 js/ui/scripting.js                   |    3 ++-
 js/ui/status/accessibility.js        |    3 ++-
 js/ui/switcherPopup.js               |    3 +++
 js/ui/viewSelector.js                |    3 +++
 js/ui/windowManager.js               |    8 ++++----
 js/ui/workspace.js                   |   13 +++++++------
 js/ui/workspaceSwitcherPopup.js      |    2 ++
 js/ui/workspaceThumbnail.js          |    3 ++-
 30 files changed, 78 insertions(+), 47 deletions(-)
---
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 4389fe7..d2c44ad 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -644,7 +644,7 @@ const LoginDialog = new Lang.Class({
                            onComplete: function() {
                                Mainloop.idle_add(Lang.bind(this, function() {
                                    this._greeter.call_start_session_when_ready_sync(serviceName, true, null);
-                                   return false;
+                                   return GLib.SOURCE_REMOVE;
                                }));
                            },
                            onCompleteScope: this });
@@ -699,6 +699,7 @@ const LoginDialog = new Lang.Class({
                                                                      function() {
                                                                          this._timedLoginAnimationTime -= 
_TIMED_LOGIN_IDLE_THRESHOLD;
                                                                          hold.release();
+                                                                         return GLib.SOURCE_REMOVE;
                                                                      });
         return hold;
     },
diff --git a/js/gdm/util.js b/js/gdm/util.js
index 66852fd..425b16e 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -250,6 +250,7 @@ const ShellUserVerifier = new Lang.Class({
                                                        Lang.bind(this, function() {
                                                            this._messageQueueTimeoutId = 0;
                                                            this._queueMessageTimeout();
+                                                           return GLib.SOURCE_REMOVE;
                                                        }));
     },
 
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index b39cc81..525adc2 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -2,6 +2,7 @@
 
 const Clutter = imports.gi.Clutter;
 const Gio = imports.gi.Gio;
+const GLib = imports.gi.GLib;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 const Meta = imports.gi.Meta;
@@ -312,7 +313,7 @@ const AppSwitcherPopup = new Lang.Class({
             this._createThumbnails();
         this._thumbnailTimeoutId = 0;
         this._thumbnailsFocused = false;
-        return false;
+        return GLib.SOURCE_REMOVE;
     },
 
     _destroyThumbnails : function() {
@@ -547,7 +548,7 @@ const AppSwitcher = new Lang.Class({
                                                         Lang.bind(this, function () {
                                                                             this._enterItem(index);
                                                                             this._mouseTimeOutId = 0;
-                                                                            return false;
+                                                                            return GLib.SOURCE_REMOVE;
                                                         }));
         } else
            this._itemEntered(index);
diff --git a/js/ui/animation.js b/js/ui/animation.js
index fb72e74..9773542 100644
--- a/js/ui/animation.js
+++ b/js/ui/animation.js
@@ -1,5 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
+const GLib = imports.gi.GLib;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 const St = imports.gi.St;
@@ -59,7 +60,7 @@ const Animation = new Lang.Class({
 
     _update: function() {
         this._showFrame(this._frame + 1);
-        return true;
+        return GLib.SOURCE_CONTINUE;
     },
 
     _animationsLoaded: function() {
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 357fcfb..360dc00 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1370,7 +1370,7 @@ const AppIcon = new Lang.Class({
                 Lang.bind(this, function() {
                     this._menuTimeoutId = 0;
                     this.popupMenu();
-                    return false;
+                    return GLib.SOURCE_REMOVE;
                 }));
         } else if (button == 3) {
             this.popupMenu();
diff --git a/js/ui/background.js b/js/ui/background.js
index 20a3a40..5eab83a 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -262,6 +262,7 @@ const BackgroundCache = new Lang.Class({
             if (params.onLoaded) {
                 GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
                     params.onLoaded(this._animation);
+                    return GLib.SOURCE_REMOVE;
                 }));
             }
         }
@@ -276,6 +277,7 @@ const BackgroundCache = new Lang.Class({
                            if (params.onLoaded) {
                                GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
                                    params.onLoaded(this._animation);
+                                   return GLib.SOURCE_REMOVE;
                                }));
                            }
                        }));
@@ -375,7 +377,7 @@ const Background = new Lang.Class({
 
         GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
             this.emit('loaded');
-            return false;
+            return GLib.SOURCE_REMOVE;
         }));
     },
 
@@ -517,7 +519,7 @@ const Background = new Lang.Class({
                                                       Lang.bind(this, function() {
                                                                     this._updateAnimationTimeoutId = 0;
                                                                     this._updateAnimation();
-                                                                    return false;
+                                                                    return GLib.SOURCE_REMOVE;
                                                                 }));
     },
 
diff --git a/js/ui/components/automountManager.js b/js/ui/components/automountManager.js
index c19fbf6..64b745e 100644
--- a/js/ui/components/automountManager.js
+++ b/js/ui/components/automountManager.js
@@ -77,7 +77,7 @@ const AutomountManager = new Lang.Class({
         }));
 
         this._mountAllId = 0;
-        return false;
+        return GLib.SOURCE_REMOVE;
     },
 
     _onDriveConnected: function() {
@@ -236,7 +236,7 @@ const AutomountManager = new Lang.Class({
     _allowAutorunExpire: function(volume) {
         Mainloop.timeout_add_seconds(AUTORUN_EXPIRE_TIMEOUT_SECS, function() {
             volume.allowAutorun = false;
-            return false;
+            return GLib.SOURCE_REMOVE;
         });
     }
 });
diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js
index b24791d..56fc2d0 100644
--- a/js/ui/components/telepathyClient.js
+++ b/js/ui/components/telepathyClient.js
@@ -675,7 +675,7 @@ const ChatSource = new Lang.Class({
 
         this._notifyTimeoutId = 0;
 
-        return false;
+        return GLib.SOURCE_REMOVE;
     },
 
     // This is called for both messages we send from
@@ -975,7 +975,7 @@ const ChatNotification = new Lang.Class({
 
         this._filterMessages();
 
-        return false;
+        return GLib.SOURCE_REMOVE;
     },
 
     appendAliasChange: function(oldAlias, newAlias) {
@@ -1013,7 +1013,7 @@ const ChatNotification = new Lang.Class({
 
         this.source.setChatState(Tp.ChannelChatState.PAUSED);
 
-        return false;
+        return GLib.SOURCE_REMOVE;
     },
 
     _onEntryChanged: function() {
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 3c5e89d..dfe8710 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -1,6 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const Clutter = imports.gi.Clutter;
+const GLib = imports.gi.GLib;
 const Signals = imports.signals;
 const Lang = imports.lang;
 const Meta = imports.gi.Meta;
@@ -577,7 +578,7 @@ const Dash = new Lang.Class({
                         this._labelShowing = true;
                         item.showLabel();
                         this._showLabelTimeoutId = 0;
-                        return false;
+                        return GLib.SOURCE_REMOVE;
                     }));
                 if (this._resetHoverTimeoutId > 0) {
                     Mainloop.source_remove(this._resetHoverTimeoutId);
@@ -594,7 +595,7 @@ const Dash = new Lang.Class({
                     Lang.bind(this, function() {
                         this._labelShowing = false;
                         this._resetHoverTimeoutId = 0;
-                        return false;
+                        return GLib.SOURCE_REMOVE;
                     }));
             }
         }
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index 042cd19..246d695 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -362,7 +362,7 @@ const _Draggable = new Lang.Class({
                 let result = motionFunc(dragEvent);
                 if (result != DragMotionResult.CONTINUE) {
                     global.screen.set_cursor(DRAG_CURSOR_MAP[result]);
-                    return false;
+                    return GLib.SOURCE_REMOVE;
                 }
             }
         }
@@ -380,13 +380,13 @@ const _Draggable = new Lang.Class({
                                                              0);
                 if (result != DragMotionResult.CONTINUE) {
                     global.screen.set_cursor(DRAG_CURSOR_MAP[result]);
-                    return false;
+                    return GLib.SOURCE_REMOVE;
                 }
             }
             target = target.get_parent();
         }
         global.screen.set_cursor(Meta.Cursor.DND_IN_DRAG);
-        return false;
+        return GLib.SOURCE_REMOVE;
     },
 
     _queueUpdateDragHover: function() {
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
index 1d43d21..b8dbf36 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
@@ -411,7 +411,7 @@ const EndSessionDialog = new Lang.Class({
                 this._secondsLeft = this._totalSecondsToStayOpen - secondsElapsed;
                 if (this._secondsLeft > 0) {
                     this._sync();
-                    return true;
+                    return GLib.SOURCE_CONTINUE;
                 }
 
                 let dialogContent = DialogContent[this._type];
@@ -419,7 +419,7 @@ const EndSessionDialog = new Lang.Class({
                 this._confirm(button.signal);
                 this._timerId = 0;
 
-                return false;
+                return GLib.SOURCE_REMOVE;
             }));
     },
 
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 008253e..b955355 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -252,7 +252,10 @@ const Keyboard = new Lang.Class({
 
         if (!this._showIdleId)
             this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE,
-                                             Lang.bind(this, function() { this.Show(time); }));
+                                             Lang.bind(this, function() {
+                                                 this.Show(time);
+                                                 return GLib.SOURCE_REMOVE;
+                                             }));
     },
 
     _createLayersForGroup: function (gname) {
@@ -479,6 +482,7 @@ const Keyboard = new Lang.Class({
                                                    Lang.bind(this, function() {
                                                        this._clearKeyboardRestTimer();
                                                        this._show(monitor);
+                                                       return GLib.SOURCE_REMOVE;
                                                    }));
     },
 
@@ -504,6 +508,7 @@ const Keyboard = new Lang.Class({
                                                    Lang.bind(this, function() {
                                                        this._clearKeyboardRestTimer();
                                                        this._hide();
+                                                       return GLib.SOURCE_REMOVE;
                                                    }));
     },
 
diff --git a/js/ui/layout.js b/js/ui/layout.js
index c74033b..13c4808 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -622,7 +622,7 @@ const LayoutManager = new Lang.Class({
         // when the system is bogged down
         GLib.idle_add(GLib.PRIORITY_LOW, Lang.bind(this, function() {
             this._startupAnimation();
-            return false;
+            return GLib.SOURCE_REMOVE;
         }));
     },
 
@@ -1039,7 +1039,7 @@ const LayoutManager = new Lang.Class({
             workspace.set_builtin_struts(struts);
         }
 
-        return false;
+        return GLib.SOURCE_REMOVE;
     }
 });
 Signals.addSignalMethods(LayoutManager.prototype);
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index 1583213..bbf35eb 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -841,6 +841,7 @@ const LookingGlass = new Lang.Class({
            this._timeoutId = Mainloop.timeout_add(500, Lang.bind(this, function () {
                 gcIcon.icon_name = 'gnome-fs-trash-full';
                 Mainloop.source_remove(this._timeoutId);
+                return GLib.SOURCE_REMOVE;
            }));
         }));
 
diff --git a/js/ui/main.js b/js/ui/main.js
index cf1a9a4..fba752b 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -609,7 +609,7 @@ function queueDeferredWork(workId) {
         _deferredTimeoutId = Mainloop.timeout_add_seconds(DEFERRED_TIMEOUT_SECONDS, function () {
             _runAllDeferredWork();
             _deferredTimeoutId = 0;
-            return false;
+            return GLib.SOURCE_REMOVE;
         });
     }
 }
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index f905768..afcfdca 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1988,23 +1988,23 @@ const MessageTray = new Lang.Class({
         this._trayDwellTimeoutId = 0;
 
         if (Main.layoutManager.bottomMonitor.inFullscreen)
-            return false;
+            return GLib.SOURCE_REMOVE;
 
         // We don't want to open the tray when a modal dialog
         // is up, so we check the modal count for that. When we are in the
         // overview we have to take the overview's modal push into account
         if (Main.modalCount > (Main.overview.visible ? 1 : 0))
-            return false;
+            return GLib.SOURCE_REMOVE;
 
         // If the user interacted with the focus window since we started the tray
         // dwell (by clicking or typing), don't activate the message tray
         let focusWindow = global.display.focus_window;
         let currentUserTime = focusWindow ? focusWindow.user_time : 0;
         if (currentUserTime != this._trayDwellUserTime)
-            return false;
+            return GLib.SOURCE_REMOVE;
 
         this.openTray();
-        return false;
+        return GLib.SOURCE_REMOVE;
     },
 
     _onNotificationKeyRelease: function(actor, event) {
@@ -2334,7 +2334,7 @@ const MessageTray = new Lang.Class({
             this._updateNotificationTimeout(0);
             this._updateState();
         }
-        return false;
+        return GLib.SOURCE_REMOVE;
     },
 
     _escapeTray: function() {
@@ -2667,7 +2667,7 @@ const MessageTray = new Lang.Class({
 
         this._lastSeenMouseX = x;
         this._lastSeenMouseY = y;
-        return false;
+        return GLib.SOURCE_REMOVE;
     },
 
     _hideNotification: function(animate) {
diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js
index d6f983d..4610780 100644
--- a/js/ui/notificationDaemon.js
+++ b/js/ui/notificationDaemon.js
@@ -247,7 +247,7 @@ const FdoNotificationDaemon = new Lang.Class({
             Mainloop.idle_add(Lang.bind(this,
                                         function () {
                                             this._emitNotificationClosed(id, 
NotificationClosedReason.DISMISSED);
-                                            return false;
+                                            return GLib.SOURCE_REMOVE;
                                         }));
             return invocation.return_value(GLib.Variant.new('(u)', [id]));
         }
diff --git a/js/ui/osdWindow.js b/js/ui/osdWindow.js
index 24f78b4..773960c 100644
--- a/js/ui/osdWindow.js
+++ b/js/ui/osdWindow.js
@@ -1,6 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const Clutter = imports.gi.Clutter;
+const GLib = imports.gi.GLib;
 const St = imports.gi.St;
 
 const Lang = imports.lang;
@@ -173,6 +174,7 @@ const OsdWindow = new Lang.Class({
                               Meta.enable_unredirect_for_screen(global.screen);
                            })
                          });
+        return GLib.SOURCE_REMOVE;
     },
 
     _reset: function() {
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 1809fe4..eb0690a 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -1,6 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const Clutter = imports.gi.Clutter;
+const GLib = imports.gi.GLib;
 const Gtk = imports.gi.Gtk;
 const Meta = imports.gi.Meta;
 const Mainloop = imports.mainloop;
@@ -369,7 +370,7 @@ const Overview = new Lang.Class({
                                                                     this._windowSwitchTimestamp);
                                                 this.hide();
                                                 this._lastHoveredWindow = null;
-                                                return false;
+                                                return GLib.SOURCE_REMOVE;
                                             }));
         }
 
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 2337a63..08d823e 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -628,6 +628,7 @@ const ActivitiesButton = new Lang.Class({
 
         Mainloop.source_remove(this._xdndTimeOut);
         this._xdndTimeOut = 0;
+        return GLib.SOURCE_REMOVE;
     }
 });
 
diff --git a/js/ui/pointerWatcher.js b/js/ui/pointerWatcher.js
index 87b4b74..5eb6718 100644
--- a/js/ui/pointerWatcher.js
+++ b/js/ui/pointerWatcher.js
@@ -1,5 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
+const GLib = imports.gi.GLib;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 const Meta = imports.gi.Meta;
@@ -110,7 +111,7 @@ const PointerWatcher = new Lang.Class({
 
     _onTimeout: function() {
         this._updatePointer();
-        return true;
+        return GLib.SOURCE_CONTINUE;
     },
 
     _updatePointer: function() {
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 9d00b6a..2321759 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -752,7 +752,7 @@ const ScreenShield = new Lang.Class({
                              });
         }
 
-        return true;
+        return GLib.SOURCE_CONTINUE;
     },
 
     _onDragBegin: function() {
@@ -848,7 +848,7 @@ const ScreenShield = new Lang.Class({
                                                        Lang.bind(this, function() {
                                                            this._lockTimeoutId = 0;
                                                            this.lock(false);
-                                                           return false;
+                                                           return GLib.SOURCE_REMOVE;
                                                        }));
         }
 
@@ -1110,6 +1110,7 @@ const ScreenShield = new Lang.Class({
 
             Mainloop.timeout_add(1000 * MANUAL_FADE_TIME, Lang.bind(this, function() {
                 this._activateFade(this._shortLightbox, MANUAL_FADE_TIME);
+                return GLib.SOURCE_REMOVE;
             }));
         } else {
             if (params.fadeToBlack)
diff --git a/js/ui/scripting.js b/js/ui/scripting.js
index edfe49d..8c8e3a3 100644
--- a/js/ui/scripting.js
+++ b/js/ui/scripting.js
@@ -1,6 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const Gio = imports.gi.Gio;
+const GLib = imports.gi.GLib;
 const Mainloop = imports.mainloop;
 const Meta = imports.gi.Meta;
 const Shell = imports.gi.Shell;
@@ -41,7 +42,7 @@ function sleep(milliseconds) {
     Mainloop.timeout_add(milliseconds, function() {
                              if (cb)
                                  cb();
-                             return false;
+                             return GLib.SOURCE_REMOVE;
                          });
 
     return function(callback) {
diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js
index 81c37bf..1ed9bf6 100644
--- a/js/ui/status/accessibility.js
+++ b/js/ui/status/accessibility.js
@@ -2,6 +2,7 @@
 
 const Clutter = imports.gi.Clutter;
 const Gio = imports.gi.Gio;
+const GLib = imports.gi.GLib;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 const St = imports.gi.St;
@@ -94,7 +95,7 @@ const ATIndicator = new Lang.Class({
 
         this.actor.visible = alwaysShow || items.some(function(f) { return !!f.state; });
 
-        return false;
+        return GLib.SOURCE_REMOVE;
     },
 
     _queueSyncMenuVisibility: function() {
diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js
index e6036b0..2e3a720 100644
--- a/js/ui/switcherPopup.js
+++ b/js/ui/switcherPopup.js
@@ -1,6 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const Clutter = imports.gi.Clutter;
+const GLib = imports.gi.GLib;
 const Gtk = imports.gi.Gtk;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
@@ -163,6 +164,7 @@ const SwitcherPopup = new Lang.Class({
                                                                Main.osdWindow.cancel();
                                                                this.actor.opacity = 255;
                                                                this._initialDelayTimeoutId = 0;
+                                                               return GLib.SOURCE_REMOVE;
                                                            }));
         return true;
     },
@@ -251,6 +253,7 @@ const SwitcherPopup = new Lang.Class({
     _mouseTimedOut: function() {
         this._motionTimeoutId = 0;
         this.mouseActive = true;
+        return GLib.SOURCE_REMOVE;
     },
 
     _popModal: function() {
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 75ef3ad..e75f7c9 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -2,6 +2,7 @@
 
 const Clutter = imports.gi.Clutter;
 const Gio = imports.gi.Gio;
+const GLib = imports.gi.GLib;
 const Gtk = imports.gi.Gtk;
 const Mainloop = imports.mainloop;
 const Meta = imports.gi.Meta;
@@ -461,6 +462,8 @@ const ViewSelector = new Lang.Class({
 
         this._searchResults.setTerms(terms);
         this._showPage(this._searchPage);
+
+        return GLib.SOURCE_REMOVE;
     },
 
     getActivePage: function() {
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 75be4c5..cbff2b0 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -106,11 +106,11 @@ const DisplayChangeDialog = new Lang.Class({
             /* mutter already takes care of failing at timeout */
             this._timeoutId = 0;
             this.close();
-            return false;
+            return GLib.SOURCE_REMOVE;
         }
 
         this._descriptionLabel.text = this._formatCountDown();
-        return true;
+        return GLib.SOURCE_CONTINUE;
     },
 
     _onFailure: function() {
@@ -278,7 +278,7 @@ const WorkspaceTracker = new Lang.Class({
         workspace._keepAliveId = Mainloop.timeout_add(duration, Lang.bind(this, function() {
             workspace._keepAliveId = 0;
             this._queueCheckWorkspaces();
-            return false;
+            return GLib.SOURCE_REMOVE;
         }));
     },
 
@@ -290,7 +290,7 @@ const WorkspaceTracker = new Lang.Class({
                 workspace._lastRemovedWindow = null;
                 this._queueCheckWorkspaces();
             }
-            return false;
+            return GLib.SOURCE_REMOVE;
         }));
     },
 
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 34090de..a8b2417 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -1,6 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const Clutter = imports.gi.Clutter;
+const GLib = imports.gi.GLib;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 const Meta = imports.gi.Meta;
@@ -472,7 +473,7 @@ const WindowOverlay = new Lang.Class({
             Mainloop.idle_add(Lang.bind(this,
                                         function() {
                                             this._windowClone.emit('selected');
-                                            return false;
+                                            return GLib.SOURCE_REMOVE;
                                         }));
         }
     },
@@ -554,7 +555,7 @@ const WindowOverlay = new Lang.Class({
             !this.closeButton.has_pointer)
             this._animateInvisible();
 
-        return false;
+        return GLib.SOURCE_REMOVE;
     },
 
     hideCloseButton: function() {
@@ -1222,18 +1223,18 @@ const Workspace = new Lang.Class({
             // store current cursor position
             this._cursorX = x;
             this._cursorY = y;
-            return true;
+            return GLib.SOURCE_CONTINUE;
         }
 
         let actorUnderPointer = global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, x, y);
         for (let i = 0; i < this._windows.length; i++) {
             if (this._windows[i].actor == actorUnderPointer)
-                return true;
+                return GLib.SOURCE_CONTINUE;
         }
 
         this._recalculateWindowPositions(WindowPositionFlags.ANIMATE);
         this._repositionWindowsId = 0;
-        return false;
+        return GLib.SOURCE_REMOVE;
     },
 
     _doRemoveWindow : function(metaWin) {
@@ -1308,7 +1309,7 @@ const Workspace = new Lang.Class({
                                                 metaWin.get_compositor_private() &&
                                                 metaWin.get_workspace() == this.metaWorkspace)
                                                 this._doAddWindow(metaWin);
-                                            return false;
+                                            return GLib.SOURCE_REMOVE;
                                         }));
             return;
         }
diff --git a/js/ui/workspaceSwitcherPopup.js b/js/ui/workspaceSwitcherPopup.js
index 4005d77..cf30421 100644
--- a/js/ui/workspaceSwitcherPopup.js
+++ b/js/ui/workspaceSwitcherPopup.js
@@ -1,6 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const Clutter = imports.gi.Clutter;
+const GLib = imports.gi.GLib;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 const Meta  = imports.gi.Meta;
@@ -156,6 +157,7 @@ const WorkspaceSwitcherPopup = new Lang.Class({
                                             onComplete: function() { this.destroy(); },
                                             onCompleteScope: this
                                            });
+        return GLib.SOURCE_REMOVE;
     },
 
     destroy: function() {
diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js
index 2379983..c3f7e00 100644
--- a/js/ui/workspaceThumbnail.js
+++ b/js/ui/workspaceThumbnail.js
@@ -2,6 +2,7 @@
 
 const Clutter = imports.gi.Clutter;
 const Gio = imports.gi.Gio;
+const GLib = imports.gi.GLib;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 const Meta = imports.gi.Meta;
@@ -325,7 +326,7 @@ const WorkspaceThumbnail = new Lang.Class({
                                                 metaWin.get_compositor_private() &&
                                                 metaWin.get_workspace() == this.metaWorkspace)
                                                 this._doAddWindow(metaWin);
-                                            return false;
+                                            return GLib.SOURCE_REMOVE;
                                         }));
             return;
         }


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