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

@ -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;
}