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
This commit is contained in:
Florian Müllner 2013-11-29 01:45:39 +01:00
parent fee2a07e08
commit 751a3f0e94
30 changed files with 78 additions and 47 deletions

View File

@ -644,7 +644,7 @@ const LoginDialog = new Lang.Class({
onComplete: function() { onComplete: function() {
Mainloop.idle_add(Lang.bind(this, function() { Mainloop.idle_add(Lang.bind(this, function() {
this._greeter.call_start_session_when_ready_sync(serviceName, true, null); this._greeter.call_start_session_when_ready_sync(serviceName, true, null);
return false; return GLib.SOURCE_REMOVE;
})); }));
}, },
onCompleteScope: this }); onCompleteScope: this });
@ -699,6 +699,7 @@ const LoginDialog = new Lang.Class({
function() { function() {
this._timedLoginAnimationTime -= _TIMED_LOGIN_IDLE_THRESHOLD; this._timedLoginAnimationTime -= _TIMED_LOGIN_IDLE_THRESHOLD;
hold.release(); hold.release();
return GLib.SOURCE_REMOVE;
}); });
return hold; return hold;
}, },

View File

@ -250,6 +250,7 @@ const ShellUserVerifier = new Lang.Class({
Lang.bind(this, function() { Lang.bind(this, function() {
this._messageQueueTimeoutId = 0; this._messageQueueTimeoutId = 0;
this._queueMessageTimeout(); this._queueMessageTimeout();
return GLib.SOURCE_REMOVE;
})); }));
}, },

View File

@ -2,6 +2,7 @@
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio; const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang; const Lang = imports.lang;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta; const Meta = imports.gi.Meta;
@ -312,7 +313,7 @@ const AppSwitcherPopup = new Lang.Class({
this._createThumbnails(); this._createThumbnails();
this._thumbnailTimeoutId = 0; this._thumbnailTimeoutId = 0;
this._thumbnailsFocused = false; this._thumbnailsFocused = false;
return false; return GLib.SOURCE_REMOVE;
}, },
_destroyThumbnails : function() { _destroyThumbnails : function() {
@ -547,7 +548,7 @@ const AppSwitcher = new Lang.Class({
Lang.bind(this, function () { Lang.bind(this, function () {
this._enterItem(index); this._enterItem(index);
this._mouseTimeOutId = 0; this._mouseTimeOutId = 0;
return false; return GLib.SOURCE_REMOVE;
})); }));
} else } else
this._itemEntered(index); this._itemEntered(index);

View File

@ -1,5 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const GLib = imports.gi.GLib;
const Lang = imports.lang; const Lang = imports.lang;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
const St = imports.gi.St; const St = imports.gi.St;
@ -59,7 +60,7 @@ const Animation = new Lang.Class({
_update: function() { _update: function() {
this._showFrame(this._frame + 1); this._showFrame(this._frame + 1);
return true; return GLib.SOURCE_CONTINUE;
}, },
_animationsLoaded: function() { _animationsLoaded: function() {

View File

@ -1370,7 +1370,7 @@ const AppIcon = new Lang.Class({
Lang.bind(this, function() { Lang.bind(this, function() {
this._menuTimeoutId = 0; this._menuTimeoutId = 0;
this.popupMenu(); this.popupMenu();
return false; return GLib.SOURCE_REMOVE;
})); }));
} else if (button == 3) { } else if (button == 3) {
this.popupMenu(); this.popupMenu();

View File

@ -262,6 +262,7 @@ const BackgroundCache = new Lang.Class({
if (params.onLoaded) { if (params.onLoaded) {
GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() { GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
params.onLoaded(this._animation); params.onLoaded(this._animation);
return GLib.SOURCE_REMOVE;
})); }));
} }
} }
@ -276,6 +277,7 @@ const BackgroundCache = new Lang.Class({
if (params.onLoaded) { if (params.onLoaded) {
GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() { GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
params.onLoaded(this._animation); 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() { GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
this.emit('loaded'); this.emit('loaded');
return false; return GLib.SOURCE_REMOVE;
})); }));
}, },
@ -517,7 +519,7 @@ const Background = new Lang.Class({
Lang.bind(this, function() { Lang.bind(this, function() {
this._updateAnimationTimeoutId = 0; this._updateAnimationTimeoutId = 0;
this._updateAnimation(); this._updateAnimation();
return false; return GLib.SOURCE_REMOVE;
})); }));
}, },

View File

@ -77,7 +77,7 @@ const AutomountManager = new Lang.Class({
})); }));
this._mountAllId = 0; this._mountAllId = 0;
return false; return GLib.SOURCE_REMOVE;
}, },
_onDriveConnected: function() { _onDriveConnected: function() {
@ -236,7 +236,7 @@ const AutomountManager = new Lang.Class({
_allowAutorunExpire: function(volume) { _allowAutorunExpire: function(volume) {
Mainloop.timeout_add_seconds(AUTORUN_EXPIRE_TIMEOUT_SECS, function() { Mainloop.timeout_add_seconds(AUTORUN_EXPIRE_TIMEOUT_SECS, function() {
volume.allowAutorun = false; volume.allowAutorun = false;
return false; return GLib.SOURCE_REMOVE;
}); });
} }
}); });

View File

@ -675,7 +675,7 @@ const ChatSource = new Lang.Class({
this._notifyTimeoutId = 0; this._notifyTimeoutId = 0;
return false; return GLib.SOURCE_REMOVE;
}, },
// This is called for both messages we send from // This is called for both messages we send from
@ -975,7 +975,7 @@ const ChatNotification = new Lang.Class({
this._filterMessages(); this._filterMessages();
return false; return GLib.SOURCE_REMOVE;
}, },
appendAliasChange: function(oldAlias, newAlias) { appendAliasChange: function(oldAlias, newAlias) {
@ -1013,7 +1013,7 @@ const ChatNotification = new Lang.Class({
this.source.setChatState(Tp.ChannelChatState.PAUSED); this.source.setChatState(Tp.ChannelChatState.PAUSED);
return false; return GLib.SOURCE_REMOVE;
}, },
_onEntryChanged: function() { _onEntryChanged: function() {

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const GLib = imports.gi.GLib;
const Signals = imports.signals; const Signals = imports.signals;
const Lang = imports.lang; const Lang = imports.lang;
const Meta = imports.gi.Meta; const Meta = imports.gi.Meta;
@ -577,7 +578,7 @@ const Dash = new Lang.Class({
this._labelShowing = true; this._labelShowing = true;
item.showLabel(); item.showLabel();
this._showLabelTimeoutId = 0; this._showLabelTimeoutId = 0;
return false; return GLib.SOURCE_REMOVE;
})); }));
if (this._resetHoverTimeoutId > 0) { if (this._resetHoverTimeoutId > 0) {
Mainloop.source_remove(this._resetHoverTimeoutId); Mainloop.source_remove(this._resetHoverTimeoutId);
@ -594,7 +595,7 @@ const Dash = new Lang.Class({
Lang.bind(this, function() { Lang.bind(this, function() {
this._labelShowing = false; this._labelShowing = false;
this._resetHoverTimeoutId = 0; this._resetHoverTimeoutId = 0;
return false; return GLib.SOURCE_REMOVE;
})); }));
} }
} }

View File

@ -362,7 +362,7 @@ const _Draggable = new Lang.Class({
let result = motionFunc(dragEvent); let result = motionFunc(dragEvent);
if (result != DragMotionResult.CONTINUE) { if (result != DragMotionResult.CONTINUE) {
global.screen.set_cursor(DRAG_CURSOR_MAP[result]); global.screen.set_cursor(DRAG_CURSOR_MAP[result]);
return false; return GLib.SOURCE_REMOVE;
} }
} }
} }
@ -380,13 +380,13 @@ const _Draggable = new Lang.Class({
0); 0);
if (result != DragMotionResult.CONTINUE) { if (result != DragMotionResult.CONTINUE) {
global.screen.set_cursor(DRAG_CURSOR_MAP[result]); global.screen.set_cursor(DRAG_CURSOR_MAP[result]);
return false; return GLib.SOURCE_REMOVE;
} }
} }
target = target.get_parent(); target = target.get_parent();
} }
global.screen.set_cursor(Meta.Cursor.DND_IN_DRAG); global.screen.set_cursor(Meta.Cursor.DND_IN_DRAG);
return false; return GLib.SOURCE_REMOVE;
}, },
_queueUpdateDragHover: function() { _queueUpdateDragHover: function() {

View File

@ -411,7 +411,7 @@ const EndSessionDialog = new Lang.Class({
this._secondsLeft = this._totalSecondsToStayOpen - secondsElapsed; this._secondsLeft = this._totalSecondsToStayOpen - secondsElapsed;
if (this._secondsLeft > 0) { if (this._secondsLeft > 0) {
this._sync(); this._sync();
return true; return GLib.SOURCE_CONTINUE;
} }
let dialogContent = DialogContent[this._type]; let dialogContent = DialogContent[this._type];
@ -419,7 +419,7 @@ const EndSessionDialog = new Lang.Class({
this._confirm(button.signal); this._confirm(button.signal);
this._timerId = 0; this._timerId = 0;
return false; return GLib.SOURCE_REMOVE;
})); }));
}, },

View File

@ -252,7 +252,10 @@ const Keyboard = new Lang.Class({
if (!this._showIdleId) if (!this._showIdleId)
this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, 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) { _createLayersForGroup: function (gname) {
@ -479,6 +482,7 @@ const Keyboard = new Lang.Class({
Lang.bind(this, function() { Lang.bind(this, function() {
this._clearKeyboardRestTimer(); this._clearKeyboardRestTimer();
this._show(monitor); this._show(monitor);
return GLib.SOURCE_REMOVE;
})); }));
}, },
@ -504,6 +508,7 @@ const Keyboard = new Lang.Class({
Lang.bind(this, function() { Lang.bind(this, function() {
this._clearKeyboardRestTimer(); this._clearKeyboardRestTimer();
this._hide(); this._hide();
return GLib.SOURCE_REMOVE;
})); }));
}, },

View File

@ -622,7 +622,7 @@ const LayoutManager = new Lang.Class({
// when the system is bogged down // when the system is bogged down
GLib.idle_add(GLib.PRIORITY_LOW, Lang.bind(this, function() { GLib.idle_add(GLib.PRIORITY_LOW, Lang.bind(this, function() {
this._startupAnimation(); this._startupAnimation();
return false; return GLib.SOURCE_REMOVE;
})); }));
}, },
@ -1039,7 +1039,7 @@ const LayoutManager = new Lang.Class({
workspace.set_builtin_struts(struts); workspace.set_builtin_struts(struts);
} }
return false; return GLib.SOURCE_REMOVE;
} }
}); });
Signals.addSignalMethods(LayoutManager.prototype); Signals.addSignalMethods(LayoutManager.prototype);

View File

@ -841,6 +841,7 @@ const LookingGlass = new Lang.Class({
this._timeoutId = Mainloop.timeout_add(500, Lang.bind(this, function () { this._timeoutId = Mainloop.timeout_add(500, Lang.bind(this, function () {
gcIcon.icon_name = 'gnome-fs-trash-full'; gcIcon.icon_name = 'gnome-fs-trash-full';
Mainloop.source_remove(this._timeoutId); Mainloop.source_remove(this._timeoutId);
return GLib.SOURCE_REMOVE;
})); }));
})); }));

View File

@ -609,7 +609,7 @@ function queueDeferredWork(workId) {
_deferredTimeoutId = Mainloop.timeout_add_seconds(DEFERRED_TIMEOUT_SECONDS, function () { _deferredTimeoutId = Mainloop.timeout_add_seconds(DEFERRED_TIMEOUT_SECONDS, function () {
_runAllDeferredWork(); _runAllDeferredWork();
_deferredTimeoutId = 0; _deferredTimeoutId = 0;
return false; return GLib.SOURCE_REMOVE;
}); });
} }
} }

View File

@ -1988,23 +1988,23 @@ const MessageTray = new Lang.Class({
this._trayDwellTimeoutId = 0; this._trayDwellTimeoutId = 0;
if (Main.layoutManager.bottomMonitor.inFullscreen) if (Main.layoutManager.bottomMonitor.inFullscreen)
return false; return GLib.SOURCE_REMOVE;
// We don't want to open the tray when a modal dialog // 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 // 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 // overview we have to take the overview's modal push into account
if (Main.modalCount > (Main.overview.visible ? 1 : 0)) 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 // If the user interacted with the focus window since we started the tray
// dwell (by clicking or typing), don't activate the message tray // dwell (by clicking or typing), don't activate the message tray
let focusWindow = global.display.focus_window; let focusWindow = global.display.focus_window;
let currentUserTime = focusWindow ? focusWindow.user_time : 0; let currentUserTime = focusWindow ? focusWindow.user_time : 0;
if (currentUserTime != this._trayDwellUserTime) if (currentUserTime != this._trayDwellUserTime)
return false; return GLib.SOURCE_REMOVE;
this.openTray(); this.openTray();
return false; return GLib.SOURCE_REMOVE;
}, },
_onNotificationKeyRelease: function(actor, event) { _onNotificationKeyRelease: function(actor, event) {
@ -2334,7 +2334,7 @@ const MessageTray = new Lang.Class({
this._updateNotificationTimeout(0); this._updateNotificationTimeout(0);
this._updateState(); this._updateState();
} }
return false; return GLib.SOURCE_REMOVE;
}, },
_escapeTray: function() { _escapeTray: function() {
@ -2667,7 +2667,7 @@ const MessageTray = new Lang.Class({
this._lastSeenMouseX = x; this._lastSeenMouseX = x;
this._lastSeenMouseY = y; this._lastSeenMouseY = y;
return false; return GLib.SOURCE_REMOVE;
}, },
_hideNotification: function(animate) { _hideNotification: function(animate) {

View File

@ -247,7 +247,7 @@ const FdoNotificationDaemon = new Lang.Class({
Mainloop.idle_add(Lang.bind(this, Mainloop.idle_add(Lang.bind(this,
function () { function () {
this._emitNotificationClosed(id, NotificationClosedReason.DISMISSED); this._emitNotificationClosed(id, NotificationClosedReason.DISMISSED);
return false; return GLib.SOURCE_REMOVE;
})); }));
return invocation.return_value(GLib.Variant.new('(u)', [id])); return invocation.return_value(GLib.Variant.new('(u)', [id]));
} }

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const GLib = imports.gi.GLib;
const St = imports.gi.St; const St = imports.gi.St;
const Lang = imports.lang; const Lang = imports.lang;
@ -173,6 +174,7 @@ const OsdWindow = new Lang.Class({
Meta.enable_unredirect_for_screen(global.screen); Meta.enable_unredirect_for_screen(global.screen);
}) })
}); });
return GLib.SOURCE_REMOVE;
}, },
_reset: function() { _reset: function() {

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk; const Gtk = imports.gi.Gtk;
const Meta = imports.gi.Meta; const Meta = imports.gi.Meta;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
@ -369,7 +370,7 @@ const Overview = new Lang.Class({
this._windowSwitchTimestamp); this._windowSwitchTimestamp);
this.hide(); this.hide();
this._lastHoveredWindow = null; this._lastHoveredWindow = null;
return false; return GLib.SOURCE_REMOVE;
})); }));
} }

View File

@ -628,6 +628,7 @@ const ActivitiesButton = new Lang.Class({
Mainloop.source_remove(this._xdndTimeOut); Mainloop.source_remove(this._xdndTimeOut);
this._xdndTimeOut = 0; this._xdndTimeOut = 0;
return GLib.SOURCE_REMOVE;
} }
}); });

View File

@ -1,5 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const GLib = imports.gi.GLib;
const Lang = imports.lang; const Lang = imports.lang;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta; const Meta = imports.gi.Meta;
@ -110,7 +111,7 @@ const PointerWatcher = new Lang.Class({
_onTimeout: function() { _onTimeout: function() {
this._updatePointer(); this._updatePointer();
return true; return GLib.SOURCE_CONTINUE;
}, },
_updatePointer: function() { _updatePointer: function() {

View File

@ -752,7 +752,7 @@ const ScreenShield = new Lang.Class({
}); });
} }
return true; return GLib.SOURCE_CONTINUE;
}, },
_onDragBegin: function() { _onDragBegin: function() {
@ -848,7 +848,7 @@ const ScreenShield = new Lang.Class({
Lang.bind(this, function() { Lang.bind(this, function() {
this._lockTimeoutId = 0; this._lockTimeoutId = 0;
this.lock(false); 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() { Mainloop.timeout_add(1000 * MANUAL_FADE_TIME, Lang.bind(this, function() {
this._activateFade(this._shortLightbox, MANUAL_FADE_TIME); this._activateFade(this._shortLightbox, MANUAL_FADE_TIME);
return GLib.SOURCE_REMOVE;
})); }));
} else { } else {
if (params.fadeToBlack) if (params.fadeToBlack)

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio; const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta; const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell; const Shell = imports.gi.Shell;
@ -41,7 +42,7 @@ function sleep(milliseconds) {
Mainloop.timeout_add(milliseconds, function() { Mainloop.timeout_add(milliseconds, function() {
if (cb) if (cb)
cb(); cb();
return false; return GLib.SOURCE_REMOVE;
}); });
return function(callback) { return function(callback) {

View File

@ -2,6 +2,7 @@
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio; const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang; const Lang = imports.lang;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
const St = imports.gi.St; 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; }); this.actor.visible = alwaysShow || items.some(function(f) { return !!f.state; });
return false; return GLib.SOURCE_REMOVE;
}, },
_queueSyncMenuVisibility: function() { _queueSyncMenuVisibility: function() {

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk; const Gtk = imports.gi.Gtk;
const Lang = imports.lang; const Lang = imports.lang;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
@ -163,6 +164,7 @@ const SwitcherPopup = new Lang.Class({
Main.osdWindow.cancel(); Main.osdWindow.cancel();
this.actor.opacity = 255; this.actor.opacity = 255;
this._initialDelayTimeoutId = 0; this._initialDelayTimeoutId = 0;
return GLib.SOURCE_REMOVE;
})); }));
return true; return true;
}, },
@ -251,6 +253,7 @@ const SwitcherPopup = new Lang.Class({
_mouseTimedOut: function() { _mouseTimedOut: function() {
this._motionTimeoutId = 0; this._motionTimeoutId = 0;
this.mouseActive = true; this.mouseActive = true;
return GLib.SOURCE_REMOVE;
}, },
_popModal: function() { _popModal: function() {

View File

@ -2,6 +2,7 @@
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio; const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk; const Gtk = imports.gi.Gtk;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta; const Meta = imports.gi.Meta;
@ -461,6 +462,8 @@ const ViewSelector = new Lang.Class({
this._searchResults.setTerms(terms); this._searchResults.setTerms(terms);
this._showPage(this._searchPage); this._showPage(this._searchPage);
return GLib.SOURCE_REMOVE;
}, },
getActivePage: function() { getActivePage: function() {

View File

@ -106,11 +106,11 @@ const DisplayChangeDialog = new Lang.Class({
/* mutter already takes care of failing at timeout */ /* mutter already takes care of failing at timeout */
this._timeoutId = 0; this._timeoutId = 0;
this.close(); this.close();
return false; return GLib.SOURCE_REMOVE;
} }
this._descriptionLabel.text = this._formatCountDown(); this._descriptionLabel.text = this._formatCountDown();
return true; return GLib.SOURCE_CONTINUE;
}, },
_onFailure: function() { _onFailure: function() {
@ -278,7 +278,7 @@ const WorkspaceTracker = new Lang.Class({
workspace._keepAliveId = Mainloop.timeout_add(duration, Lang.bind(this, function() { workspace._keepAliveId = Mainloop.timeout_add(duration, Lang.bind(this, function() {
workspace._keepAliveId = 0; workspace._keepAliveId = 0;
this._queueCheckWorkspaces(); this._queueCheckWorkspaces();
return false; return GLib.SOURCE_REMOVE;
})); }));
}, },
@ -290,7 +290,7 @@ const WorkspaceTracker = new Lang.Class({
workspace._lastRemovedWindow = null; workspace._lastRemovedWindow = null;
this._queueCheckWorkspaces(); this._queueCheckWorkspaces();
} }
return false; return GLib.SOURCE_REMOVE;
})); }));
}, },

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const GLib = imports.gi.GLib;
const Lang = imports.lang; const Lang = imports.lang;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta; const Meta = imports.gi.Meta;
@ -472,7 +473,7 @@ const WindowOverlay = new Lang.Class({
Mainloop.idle_add(Lang.bind(this, Mainloop.idle_add(Lang.bind(this,
function() { function() {
this._windowClone.emit('selected'); this._windowClone.emit('selected');
return false; return GLib.SOURCE_REMOVE;
})); }));
} }
}, },
@ -554,7 +555,7 @@ const WindowOverlay = new Lang.Class({
!this.closeButton.has_pointer) !this.closeButton.has_pointer)
this._animateInvisible(); this._animateInvisible();
return false; return GLib.SOURCE_REMOVE;
}, },
hideCloseButton: function() { hideCloseButton: function() {
@ -1222,18 +1223,18 @@ const Workspace = new Lang.Class({
// store current cursor position // store current cursor position
this._cursorX = x; this._cursorX = x;
this._cursorY = y; this._cursorY = y;
return true; return GLib.SOURCE_CONTINUE;
} }
let actorUnderPointer = global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, x, y); let actorUnderPointer = global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, x, y);
for (let i = 0; i < this._windows.length; i++) { for (let i = 0; i < this._windows.length; i++) {
if (this._windows[i].actor == actorUnderPointer) if (this._windows[i].actor == actorUnderPointer)
return true; return GLib.SOURCE_CONTINUE;
} }
this._recalculateWindowPositions(WindowPositionFlags.ANIMATE); this._recalculateWindowPositions(WindowPositionFlags.ANIMATE);
this._repositionWindowsId = 0; this._repositionWindowsId = 0;
return false; return GLib.SOURCE_REMOVE;
}, },
_doRemoveWindow : function(metaWin) { _doRemoveWindow : function(metaWin) {
@ -1308,7 +1309,7 @@ const Workspace = new Lang.Class({
metaWin.get_compositor_private() && metaWin.get_compositor_private() &&
metaWin.get_workspace() == this.metaWorkspace) metaWin.get_workspace() == this.metaWorkspace)
this._doAddWindow(metaWin); this._doAddWindow(metaWin);
return false; return GLib.SOURCE_REMOVE;
})); }));
return; return;
} }

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const GLib = imports.gi.GLib;
const Lang = imports.lang; const Lang = imports.lang;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta; const Meta = imports.gi.Meta;
@ -156,6 +157,7 @@ const WorkspaceSwitcherPopup = new Lang.Class({
onComplete: function() { this.destroy(); }, onComplete: function() { this.destroy(); },
onCompleteScope: this onCompleteScope: this
}); });
return GLib.SOURCE_REMOVE;
}, },
destroy: function() { destroy: function() {

View File

@ -2,6 +2,7 @@
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio; const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang; const Lang = imports.lang;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta; const Meta = imports.gi.Meta;
@ -325,7 +326,7 @@ const WorkspaceThumbnail = new Lang.Class({
metaWin.get_compositor_private() && metaWin.get_compositor_private() &&
metaWin.get_workspace() == this.metaWorkspace) metaWin.get_workspace() == this.metaWorkspace)
this._doAddWindow(metaWin); this._doAddWindow(metaWin);
return false; return GLib.SOURCE_REMOVE;
})); }));
return; return;
} }