js: Use EVENT_PROPAGATE/EVENT_STOP constants in event handlers

Just as SOURCE_CONTINUE/SOURCE_REMOVE in source functions, these
constants increase code clarity over plain true/false.

https://bugzilla.gnome.org/show_bug.cgi?id=719567
This commit is contained in:
Florian Müllner 2013-11-29 18:17:34 +00:00
parent 751a3f0e94
commit deb2f30b37
31 changed files with 178 additions and 143 deletions

View File

@ -80,6 +80,7 @@ const AuthPrompt = new Lang.Class({
if (event.get_key_symbol() == Clutter.KEY_Escape) { if (event.get_key_symbol() == Clutter.KEY_Escape) {
this.cancel(); this.cancel();
} }
return Clutter.EVENT_PROPAGATE;
})); }));
this._userWell = new St.Bin({ x_fill: true, this._userWell = new St.Bin({ x_fill: true,

View File

@ -764,7 +764,7 @@ const LoginDialog = new Lang.Class({
global.stage.connect('captured-event', global.stage.connect('captured-event',
Lang.bind(this, function(actor, event) { Lang.bind(this, function(actor, event) {
if (this._timedLoginDelay == undefined) if (this._timedLoginDelay == undefined)
return false; return Clutter.EVENT_PROPAGATE;
if (event.type() == Clutter.EventType.KEY_PRESS || if (event.type() == Clutter.EventType.KEY_PRESS ||
event.type() == Clutter.EventType.BUTTON_PRESS) { event.type() == Clutter.EventType.BUTTON_PRESS) {
@ -777,7 +777,7 @@ const LoginDialog = new Lang.Class({
this._resetTimedLogin(); this._resetTimedLogin();
} }
return false; return Clutter.EVENT_PROPAGATE;
})); }));
}, },

View File

@ -89,7 +89,7 @@ const HistoryManager = new Lang.Class({
} else if (symbol == Clutter.KEY_Down) { } else if (symbol == Clutter.KEY_Down) {
return this._setNextItem(entry.get_text()); return this._setNextItem(entry.get_text());
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_indexChanged: function() { _indexChanged: function() {

View File

@ -415,7 +415,7 @@ const AllView = new Lang.Class({
_onScroll: function(actor, event) { _onScroll: function(actor, event) {
if (this._displayingPopup) if (this._displayingPopup)
return true; return Clutter.EVENT_STOP;
let direction = event.get_scroll_direction(); let direction = event.get_scroll_direction();
if (direction == Clutter.ScrollDirection.UP) if (direction == Clutter.ScrollDirection.UP)
@ -423,7 +423,7 @@ const AllView = new Lang.Class({
else if (direction == Clutter.ScrollDirection.DOWN) else if (direction == Clutter.ScrollDirection.DOWN)
this.goToPage(this._currentPage + 1); this.goToPage(this._currentPage + 1);
return true; return Clutter.EVENT_STOP;
}, },
_onPan: function(action) { _onPan: function(action) {
@ -454,17 +454,17 @@ const AllView = new Lang.Class({
_onKeyPressEvent: function(actor, event) { _onKeyPressEvent: function(actor, event) {
if (this._displayingPopup) if (this._displayingPopup)
return true; return Clutter.EVENT_STOP;
if (event.get_key_symbol() == Clutter.Page_Up) { if (event.get_key_symbol() == Clutter.Page_Up) {
this.goToPage(this._currentPage - 1); this.goToPage(this._currentPage - 1);
return true; return Clutter.EVENT_STOP;
} else if (event.get_key_symbol() == Clutter.Page_Down) { } else if (event.get_key_symbol() == Clutter.Page_Down) {
this.goToPage(this._currentPage + 1); this.goToPage(this._currentPage + 1);
return true; return Clutter.EVENT_STOP;
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_getItemId: function(item) { _getItemId: function(item) {
@ -1223,13 +1223,13 @@ const AppFolderPopup = new Lang.Class({
_onKeyPress: function(actor, event) { _onKeyPress: function(actor, event) {
if (!this._isOpen) if (!this._isOpen)
return false; return Clutter.EVENT_PROPAGATE;
if (event.get_key_symbol() != Clutter.KEY_Escape) if (event.get_key_symbol() != Clutter.KEY_Escape)
return false; return Clutter.EVENT_PROPAGATE;
this.popdown(); this.popdown();
return true; return Clutter.EVENT_STOP;
}, },
toggle: function() { toggle: function() {
@ -1374,9 +1374,9 @@ const AppIcon = new Lang.Class({
})); }));
} else if (button == 3) { } else if (button == 3) {
this.popupMenu(); this.popupMenu();
return true; return Clutter.EVENT_STOP;
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_onClicked: function(actor, button) { _onClicked: function(actor, button) {

View File

@ -69,7 +69,7 @@ const BoxPointer = new Lang.Class({
_muteInput: function() { _muteInput: function() {
if (this._capturedEventId == 0) if (this._capturedEventId == 0)
this._capturedEventId = this.actor.connect('captured-event', this._capturedEventId = this.actor.connect('captured-event',
function() { return true; }); function() { return Clutter.EVENT_STOP; });
}, },
_unmuteInput: function() { _unmuteInput: function() {

View File

@ -497,6 +497,7 @@ const Calendar = new Lang.Class({
this._onNextMonthButtonClicked(); this._onNextMonthButtonClicked();
break; break;
} }
return Clutter.EVENT_PROPAGATE;
}, },
_onPrevMonthButtonClicked: function() { _onPrevMonthButtonClicked: function() {

View File

@ -106,10 +106,10 @@ const _Draggable = new Lang.Class({
_onButtonPress : function (actor, event) { _onButtonPress : function (actor, event) {
if (event.get_button() != 1) if (event.get_button() != 1)
return false; return Clutter.EVENT_PROPAGATE;
if (Tweener.getTweenCount(actor)) if (Tweener.getTweenCount(actor))
return false; return Clutter.EVENT_PROPAGATE;
this._buttonDown = true; this._buttonDown = true;
this._grabActor(); this._grabActor();
@ -118,7 +118,7 @@ const _Draggable = new Lang.Class({
this._dragStartX = stageX; this._dragStartX = stageX;
this._dragStartY = stageY; this._dragStartY = stageY;
return false; return Clutter.EVENT_PROPAGATE;
}, },
_grabActor: function() { _grabActor: function() {
@ -164,11 +164,11 @@ const _Draggable = new Lang.Class({
} else if (this._dragActor != null && !this._animationInProgress) { } else if (this._dragActor != null && !this._animationInProgress) {
// Drag must have been cancelled with Esc. // Drag must have been cancelled with Esc.
this._dragComplete(); this._dragComplete();
return true; return Clutter.EVENT_STOP;
} else { } else {
// Drag has never started. // Drag has never started.
this._ungrabActor(); this._ungrabActor();
return false; return Clutter.EVENT_PROPAGATE;
} }
// We intercept MOTION event to figure out if the drag has started and to draw // We intercept MOTION event to figure out if the drag has started and to draw
// this._dragActor under the pointer when dragging is in progress // this._dragActor under the pointer when dragging is in progress
@ -184,11 +184,11 @@ const _Draggable = new Lang.Class({
let symbol = event.get_key_symbol(); let symbol = event.get_key_symbol();
if (symbol == Clutter.Escape) { if (symbol == Clutter.Escape) {
this._cancelDrag(event.get_time()); this._cancelDrag(event.get_time());
return true; return Clutter.EVENT_STOP;
} }
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
/** /**

View File

@ -280,7 +280,7 @@ const GrabHelper = new Lang.Class({
if (type == Clutter.EventType.KEY_PRESS && if (type == Clutter.EventType.KEY_PRESS &&
event.get_key_symbol() == Clutter.KEY_Escape) { event.get_key_symbol() == Clutter.KEY_Escape) {
this.ungrab({ isUser: true }); this.ungrab({ isUser: true });
return true; return Clutter.EVENT_STOP;
} }
let press = type == Clutter.EventType.BUTTON_PRESS; let press = type == Clutter.EventType.BUTTON_PRESS;
@ -289,14 +289,14 @@ const GrabHelper = new Lang.Class({
if (release && this._ignoreRelease) { if (release && this._ignoreRelease) {
this._ignoreRelease = false; this._ignoreRelease = false;
return true; return Clutter.EVENT_STOP;
} }
if (this._isWithinGrabbedActor(event.get_source())) if (this._isWithinGrabbedActor(event.get_source()))
return false; return Clutter.EVENT_PROPAGATE;
if (Main.keyboard.shouldTakeEvent(event)) if (Main.keyboard.shouldTakeEvent(event))
return false; return Clutter.EVENT_PROPAGATE;
if (button) { if (button) {
// If we have a press event, ignore the next event, // If we have a press event, ignore the next event,
@ -305,9 +305,9 @@ const GrabHelper = new Lang.Class({
this._ignoreRelease = true; this._ignoreRelease = true;
let i = this._actorInGrabStack(event.get_source()) + 1; let i = this._actorInGrabStack(event.get_source()) + 1;
this.ungrab({ actor: this._grabStack[i].actor, isUser: true }); this.ungrab({ actor: this._grabStack[i].actor, isUser: true });
return true; return Clutter.EVENT_STOP;
} }
return true; return Clutter.EVENT_STOP;
}, },
}); });

View File

@ -32,6 +32,7 @@ const CandidateArea = new Lang.Class({
let j = i; let j = i;
box.connect('button-release-event', Lang.bind(this, function(actor, event) { box.connect('button-release-event', Lang.bind(this, function(actor, event) {
this.emit('candidate-clicked', j, event.get_button(), event.get_state()); this.emit('candidate-clicked', j, event.get_button(), event.get_state());
return Clutter.EVENT_PROPAGATE;
})); }));
} }

View File

@ -82,8 +82,16 @@ const Key = new Lang.Class({
style_class: 'keyboard-key' }); style_class: 'keyboard-key' });
button.key_width = this._key.width; button.key_width = this._key.width;
button.connect('button-press-event', Lang.bind(this, function () { this._key.press(); })); button.connect('button-press-event', Lang.bind(this,
button.connect('button-release-event', Lang.bind(this, function () { this._key.release(); })); function () {
this._key.press();
return Clutter.EVENT_PROPAGATE;
}));
button.connect('button-release-event', Lang.bind(this,
function () {
this._key.release();
return Clutter.EVENT_PROPAGATE;
}));
return button; return button;
}, },
@ -106,8 +114,16 @@ const Key = new Lang.Class({
let label = this._getUnichar(extended_key); let label = this._getUnichar(extended_key);
let key = new St.Button({ label: label, style_class: 'keyboard-key' }); let key = new St.Button({ label: label, style_class: 'keyboard-key' });
key.extended_key = extended_key; key.extended_key = extended_key;
key.connect('button-press-event', Lang.bind(this, function () { extended_key.press(); })); key.connect('button-press-event', Lang.bind(this,
key.connect('button-release-event', Lang.bind(this, function () { extended_key.release(); })); function () {
extended_key.press();
return Clutter.EVENT_PROPAGATE;
}));
key.connect('button-release-event', Lang.bind(this,
function () {
extended_key.release();
return Clutter.EVENT_PROPAGATE;
}));
this._extended_keyboard.add(key); this._extended_keyboard.add(key);
} }
this._boxPointer.bin.add_actor(this._extended_keyboard); this._boxPointer.bin.add_actor(this._extended_keyboard);
@ -297,7 +313,7 @@ const Keyboard = new Lang.Class({
else if (release && this._capturedPress) else if (release && this._capturedPress)
this._hideSubkeys(); this._hideSubkeys();
return true; return Clutter.EVENT_STOP;
}, },
_addRows : function (keys, layout) { _addRows : function (keys, layout) {

View File

@ -1226,20 +1226,20 @@ const HotCorner = new Lang.Class({
this._entered = true; this._entered = true;
this._toggleOverview(); this._toggleOverview();
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_onCornerLeft : function(actor, event) { _onCornerLeft : function(actor, event) {
if (event.get_related() != this.actor) if (event.get_related() != this.actor)
this._entered = false; this._entered = false;
// Consume event, otherwise this will confuse onEnvironsLeft // Consume event, otherwise this will confuse onEnvironsLeft
return true; return Clutter.EVENT_STOP;
}, },
_onEnvironsLeft : function(actor, event) { _onEnvironsLeft : function(actor, event) {
if (event.get_related() != this._corner) if (event.get_related() != this._corner)
this._entered = false; this._entered = false;
return false; return Clutter.EVENT_PROPAGATE;
} }
}); });

View File

@ -109,6 +109,7 @@ const AutoComplete = new Lang.Class({
} }
this._lastTabTime = currTime; this._lastTabTime = currTime;
} }
return Clutter.EVENT_PROPAGATE;
}, },
// Insert characters of text not already included in head at cursor position. i.e., if text="abc" and head="a", // Insert characters of text not already included in head at cursor position. i.e., if text="abc" and head="a",
@ -558,7 +559,7 @@ const Inspector = new Lang.Class({
_onKeyPressEvent: function (actor, event) { _onKeyPressEvent: function (actor, event) {
if (event.get_key_symbol() == Clutter.Escape) if (event.get_key_symbol() == Clutter.Escape)
this._close(); this._close();
return true; return Clutter.EVENT_STOP;
}, },
_onButtonPressEvent: function (actor, event) { _onButtonPressEvent: function (actor, event) {
@ -567,7 +568,7 @@ const Inspector = new Lang.Class({
this.emit('target', this._target, stageX, stageY); this.emit('target', this._target, stageX, stageY);
} }
this._close(); this._close();
return true; return Clutter.EVENT_STOP;
}, },
_onScrollEvent: function (actor, event) { _onScrollEvent: function (actor, event) {
@ -601,12 +602,12 @@ const Inspector = new Lang.Class({
default: default:
break; break;
} }
return true; return Clutter.EVENT_STOP;
}, },
_onMotionEvent: function (actor, event) { _onMotionEvent: function (actor, event) {
this._update(event); this._update(event);
return true; return Clutter.EVENT_STOP;
}, },
_update: function(event) { _update: function(event) {
@ -828,7 +829,7 @@ const LookingGlass = new Lang.Class({
global.stage.set_key_focus(this._entry); global.stage.set_key_focus(this._entry);
})); }));
this.actor.hide(); this.actor.hide();
return true; return Clutter.EVENT_STOP;
})); }));
let gcIcon = new St.Icon({ icon_name: 'gnome-fs-trash-full', let gcIcon = new St.Icon({ icon_name: 'gnome-fs-trash-full',
@ -843,6 +844,7 @@ const LookingGlass = new Lang.Class({
Mainloop.source_remove(this._timeoutId); Mainloop.source_remove(this._timeoutId);
return GLib.SOURCE_REMOVE; return GLib.SOURCE_REMOVE;
})); }));
return Clutter.EVENT_PROPAGATE;
})); }));
let notebook = new Notebook(); let notebook = new Notebook();
@ -1064,7 +1066,7 @@ const LookingGlass = new Lang.Class({
} else { } else {
this.close(); this.close();
} }
return true; return Clutter.EVENT_STOP;
} }
// Ctrl+PgUp and Ctrl+PgDown switches tabs in the notebook view // Ctrl+PgUp and Ctrl+PgDown switches tabs in the notebook view
if (modifierState & Clutter.ModifierType.CONTROL_MASK) { if (modifierState & Clutter.ModifierType.CONTROL_MASK) {
@ -1074,7 +1076,7 @@ const LookingGlass = new Lang.Class({
this._notebook.nextTab(); this._notebook.nextTab();
} }
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
open : function() { open : function() {

View File

@ -187,7 +187,7 @@ const URLHighlighter = new Lang.Class({
// The MessageTray doesn't actually hide us, so // The MessageTray doesn't actually hide us, so
// we need to check for paint opacities as well. // we need to check for paint opacities as well.
if (!actor.visible || actor.get_paint_opacity() == 0) if (!actor.visible || actor.get_paint_opacity() == 0)
return false; return Clutter.EVENT_PROPAGATE;
// Keep Notification.actor from seeing this and taking // Keep Notification.actor from seeing this and taking
// a pointer grab, which would block our button-release-event // a pointer grab, which would block our button-release-event
@ -196,7 +196,7 @@ const URLHighlighter = new Lang.Class({
})); }));
this.actor.connect('button-release-event', Lang.bind(this, function (actor, event) { this.actor.connect('button-release-event', Lang.bind(this, function (actor, event) {
if (!actor.visible || actor.get_paint_opacity() == 0) if (!actor.visible || actor.get_paint_opacity() == 0)
return false; return Clutter.EVENT_PROPAGATE;
let urlId = this._findUrlAtPos(event); let urlId = this._findUrlAtPos(event);
if (urlId != -1) { if (urlId != -1) {
@ -205,13 +205,13 @@ const URLHighlighter = new Lang.Class({
url = 'http://' + url; url = 'http://' + url;
Gio.app_info_launch_default_for_uri(url, global.create_app_launch_context()); Gio.app_info_launch_default_for_uri(url, global.create_app_launch_context());
return true; return Clutter.EVENT_STOP;
} }
return false; return Clutter.EVENT_PROPAGATE;
})); }));
this.actor.connect('motion-event', Lang.bind(this, function(actor, event) { this.actor.connect('motion-event', Lang.bind(this, function(actor, event) {
if (!actor.visible || actor.get_paint_opacity() == 0) if (!actor.visible || actor.get_paint_opacity() == 0)
return false; return Clutter.EVENT_PROPAGATE;
let urlId = this._findUrlAtPos(event); let urlId = this._findUrlAtPos(event);
if (urlId != -1 && !this._cursorChanged) { if (urlId != -1 && !this._cursorChanged) {
@ -221,16 +221,17 @@ const URLHighlighter = new Lang.Class({
global.screen.set_cursor(Meta.Cursor.DEFAULT); global.screen.set_cursor(Meta.Cursor.DEFAULT);
this._cursorChanged = false; this._cursorChanged = false;
} }
return false; return Clutter.EVENT_PROPAGATE;
})); }));
this.actor.connect('leave-event', Lang.bind(this, function() { this.actor.connect('leave-event', Lang.bind(this, function() {
if (!this.actor.visible || this.actor.get_paint_opacity() == 0) if (!this.actor.visible || this.actor.get_paint_opacity() == 0)
return; return Clutter.EVENT_PROPAGATE;
if (this._cursorChanged) { if (this._cursorChanged) {
this._cursorChanged = false; this._cursorChanged = false;
global.screen.set_cursor(Meta.Cursor.DEFAULT); global.screen.set_cursor(Meta.Cursor.DEFAULT);
} }
return Clutter.EVENT_PROPAGATE;
})); }));
}, },
@ -1523,9 +1524,9 @@ const SummaryItem = new Lang.Class({
_onKeyPress: function(actor, event) { _onKeyPress: function(actor, event) {
if (event.get_key_symbol() == Clutter.KEY_Up) { if (event.get_key_symbol() == Clutter.KEY_Up) {
actor.emit('clicked', 1); actor.emit('clicked', 1);
return true; return Clutter.EVENT_STOP;
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
prepareNotificationStackForShowing: function() { prepareNotificationStackForShowing: function() {
@ -1783,6 +1784,7 @@ const MessageTray = new Lang.Class({
this._setClickedSummaryItem(null); this._setClickedSummaryItem(null);
this._updateState(); this._updateState();
actor.grab_key_focus(); actor.grab_key_focus();
return Clutter.EVENT_PROPAGATE;
})); }));
global.focus_manager.add_group(this.actor); global.focus_manager.add_group(this.actor);
this._summary = new St.BoxLayout({ style_class: 'message-tray-summary', this._summary = new St.BoxLayout({ style_class: 'message-tray-summary',
@ -2010,10 +2012,10 @@ const MessageTray = new Lang.Class({
_onNotificationKeyRelease: function(actor, event) { _onNotificationKeyRelease: function(actor, event) {
if (event.get_key_symbol() == Clutter.KEY_Escape && event.get_state() == 0) { if (event.get_key_symbol() == Clutter.KEY_Escape && event.get_state() == 0) {
this._closeNotification(); this._closeNotification();
return true; return Clutter.EVENT_STOP;
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_closeNotification: function() { _closeNotification: function() {
@ -2865,13 +2867,13 @@ const MessageTray = new Lang.Class({
case Clutter.KEY_Escape: case Clutter.KEY_Escape:
this._setClickedSummaryItem(null); this._setClickedSummaryItem(null);
this._updateState(); this._updateState();
return true; return Clutter.EVENT_STOP;
case Clutter.KEY_Delete: case Clutter.KEY_Delete:
this._clickedSummaryItem.source.destroy(); this._clickedSummaryItem.source.destroy();
this._escapeTray(); this._escapeTray();
return true; return Clutter.EVENT_STOP;
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_onSummaryBoxPointerUngrabbed: function() { _onSummaryBoxPointerUngrabbed: function() {

View File

@ -229,6 +229,7 @@ const ModalDialog = new Lang.Class({
_onKeyPressEvent: function(object, event) { _onKeyPressEvent: function(object, event) {
this._pressedKey = event.get_key_symbol(); this._pressedKey = event.get_key_symbol();
return Clutter.EVENT_PROPAGATE;
}, },
_onKeyReleaseEvent: function(object, event) { _onKeyReleaseEvent: function(object, event) {
@ -237,21 +238,21 @@ const ModalDialog = new Lang.Class({
let symbol = event.get_key_symbol(); let symbol = event.get_key_symbol();
if (symbol != pressedKey) if (symbol != pressedKey)
return false; return Clutter.EVENT_PROPAGATE;
let buttonInfo = this._buttonKeys[symbol]; let buttonInfo = this._buttonKeys[symbol];
if (!buttonInfo) if (!buttonInfo)
return false; return Clutter.EVENT_PROPAGATE;
let button = buttonInfo['button']; let button = buttonInfo['button'];
let action = buttonInfo['action']; let action = buttonInfo['action'];
if (action && button.reactive) { if (action && button.reactive) {
action(); action();
return true; return Clutter.EVENT_STOP;
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_onGroupDestroy: function() { _onGroupDestroy: function() {

View File

@ -148,7 +148,7 @@ const Overview = new Lang.Class({
this._coverPane = new Clutter.Actor({ opacity: 0, this._coverPane = new Clutter.Actor({ opacity: 0,
reactive: true }); reactive: true });
Main.layoutManager.overviewGroup.add_child(this._coverPane); Main.layoutManager.overviewGroup.add_child(this._coverPane);
this._coverPane.connect('event', Lang.bind(this, function (actor, event) { return true; })); this._coverPane.connect('event', Lang.bind(this, function (actor, event) { return Clutter.EVENT_STOP; }));
this._stack.add_actor(this._overview); this._stack.add_actor(this._overview);
Main.layoutManager.overviewGroup.add_child(this._stack); Main.layoutManager.overviewGroup.add_child(this._stack);
@ -379,6 +379,7 @@ const Overview = new Lang.Class({
_onScrollEvent: function(actor, event) { _onScrollEvent: function(actor, event) {
this.emit('scroll-event', event); this.emit('scroll-event', event);
return Clutter.EVENT_PROPAGATE;
}, },
addAction: function(action) { addAction: function(action) {

View File

@ -602,14 +602,15 @@ const ActivitiesButton = new Lang.Class({
_onCapturedEvent: function(actor, event) { _onCapturedEvent: function(actor, event) {
if (event.type() == Clutter.EventType.BUTTON_PRESS) { if (event.type() == Clutter.EventType.BUTTON_PRESS) {
if (!Main.overview.shouldToggleByCornerOrButton()) if (!Main.overview.shouldToggleByCornerOrButton())
return true; return Clutter.EVENT_STOP;
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_onButtonRelease: function() { _onButtonRelease: function() {
Main.overview.toggle(); Main.overview.toggle();
this.menu.close(); this.menu.close();
return Clutter.EVENT_PROPAGATE;
}, },
_onKeyRelease: function(actor, event) { _onKeyRelease: function(actor, event) {
@ -617,6 +618,7 @@ const ActivitiesButton = new Lang.Class({
if (symbol == Clutter.KEY_Return || symbol == Clutter.KEY_space) { if (symbol == Clutter.KEY_Return || symbol == Clutter.KEY_space) {
Main.overview.toggle(); Main.overview.toggle();
} }
return Clutter.EVENT_PROPAGATE;
}, },
_xdndToggleOverview: function(actor) { _xdndToggleOverview: function(actor) {
@ -984,23 +986,23 @@ const Panel = new Lang.Class({
_onButtonPress: function(actor, event) { _onButtonPress: function(actor, event) {
if (Main.modalCount > 0) if (Main.modalCount > 0)
return false; return Clutter.EVENT_PROPAGATE;
if (event.get_source() != actor) if (event.get_source() != actor)
return false; return Clutter.EVENT_PROPAGATE;
let button = event.get_button(); let button = event.get_button();
if (button != 1) if (button != 1)
return false; return Clutter.EVENT_PROPAGATE;
let focusWindow = global.display.focus_window; let focusWindow = global.display.focus_window;
if (!focusWindow) if (!focusWindow)
return false; return Clutter.EVENT_PROPAGATE;
let dragWindow = focusWindow.is_attached_dialog() ? focusWindow.get_transient_for() let dragWindow = focusWindow.is_attached_dialog() ? focusWindow.get_transient_for()
: focusWindow; : focusWindow;
if (!dragWindow) if (!dragWindow)
return false; return Clutter.EVENT_PROPAGATE;
let rect = dragWindow.get_outer_rect(); let rect = dragWindow.get_outer_rect();
let [stageX, stageY] = event.get_coords(); let [stageX, stageY] = event.get_coords();
@ -1009,7 +1011,7 @@ const Panel = new Lang.Class({
stageX > rect.x && stageX < rect.x + rect.width; stageX > rect.x && stageX < rect.x + rect.width;
if (!allowDrag) if (!allowDrag)
return false; return Clutter.EVENT_PROPAGATE;
global.display.begin_grab_op(global.screen, global.display.begin_grab_op(global.screen,
dragWindow, dragWindow,
@ -1021,7 +1023,7 @@ const Panel = new Lang.Class({
event.get_time(), event.get_time(),
stageX, stageY); stageX, stageY);
return true; return Clutter.EVENT_STOP;
}, },
toggleAppMenu: function() { toggleAppMenu: function() {

View File

@ -137,29 +137,30 @@ const Button = new Lang.Class({
_onButtonPress: function(actor, event) { _onButtonPress: function(actor, event) {
if (!this.menu) if (!this.menu)
return; return Clutter.EVENT_PROPAGATE;
this.menu.toggle(); this.menu.toggle();
return Clutter.EVENT_PROPAGATE;
}, },
_onSourceKeyPress: function(actor, event) { _onSourceKeyPress: function(actor, event) {
if (!this.menu) if (!this.menu)
return false; return Clutter.EVENT_PROPAGATE;
let symbol = event.get_key_symbol(); let symbol = event.get_key_symbol();
if (symbol == Clutter.KEY_space || symbol == Clutter.KEY_Return) { if (symbol == Clutter.KEY_space || symbol == Clutter.KEY_Return) {
this.menu.toggle(); this.menu.toggle();
return true; return Clutter.EVENT_STOP;
} else if (symbol == Clutter.KEY_Escape && this.menu.isOpen) { } else if (symbol == Clutter.KEY_Escape && this.menu.isOpen) {
this.menu.close(); this.menu.close();
return true; return Clutter.EVENT_STOP;
} else if (symbol == Clutter.KEY_Down) { } else if (symbol == Clutter.KEY_Down) {
if (!this.menu.isOpen) if (!this.menu.isOpen)
this.menu.toggle(); this.menu.toggle();
this.menu.actor.navigate_focus(this.actor, Gtk.DirectionType.DOWN, false); this.menu.actor.navigate_focus(this.actor, Gtk.DirectionType.DOWN, false);
return true; return Clutter.EVENT_STOP;
} else } else
return false; return Clutter.EVENT_PROPAGATE;
}, },
_onVisibilityChanged: function() { _onVisibilityChanged: function() {
@ -172,7 +173,7 @@ const Button = new Lang.Class({
_onMenuKeyPress: function(actor, event) { _onMenuKeyPress: function(actor, event) {
if (global.focus_manager.navigate_from_event(event)) if (global.focus_manager.navigate_from_event(event))
return true; return Clutter.EVENT_STOP;
let symbol = event.get_key_symbol(); let symbol = event.get_key_symbol();
if (symbol == Clutter.KEY_Left || symbol == Clutter.KEY_Right) { if (symbol == Clutter.KEY_Left || symbol == Clutter.KEY_Right) {
@ -180,10 +181,10 @@ const Button = new Lang.Class({
if (group) { if (group) {
let direction = (symbol == Clutter.KEY_Left) ? Gtk.DirectionType.LEFT : Gtk.DirectionType.RIGHT; let direction = (symbol == Clutter.KEY_Left) ? Gtk.DirectionType.LEFT : Gtk.DirectionType.RIGHT;
group.navigate_focus(this.actor, direction, false); group.navigate_focus(this.actor, direction, false);
return true; return Clutter.EVENT_STOP;
} }
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_onOpenStateChanged: function(menu, open) { _onOpenStateChanged: function(menu, open) {

View File

@ -126,7 +126,7 @@ const PopupBaseMenuItem = new Lang.Class({
_onButtonReleaseEvent: function (actor, event) { _onButtonReleaseEvent: function (actor, event) {
this.activate(event); this.activate(event);
return true; return Clutter.EVENT_STOP;
}, },
_onKeyPressEvent: function (actor, event) { _onKeyPressEvent: function (actor, event) {
@ -134,9 +134,9 @@ const PopupBaseMenuItem = new Lang.Class({
if (symbol == Clutter.KEY_space || symbol == Clutter.KEY_Return) { if (symbol == Clutter.KEY_space || symbol == Clutter.KEY_Return) {
this.activate(event); this.activate(event);
return true; return Clutter.EVENT_STOP;
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_onKeyFocusIn: function (actor) { _onKeyFocusIn: function (actor) {
@ -928,10 +928,10 @@ const PopupSubMenu = new Lang.Class({
if (this.isOpen && event.get_key_symbol() == Clutter.KEY_Left) { if (this.isOpen && event.get_key_symbol() == Clutter.KEY_Left) {
this.close(BoxPointer.PopupAnimation.FULL); this.close(BoxPointer.PopupAnimation.FULL);
this.sourceActor._delegate.setActive(true); this.sourceActor._delegate.setActive(true);
return true; return Clutter.EVENT_STOP;
} }
return false; return Clutter.EVENT_PROPAGATE;
} }
}); });
@ -1056,10 +1056,10 @@ const PopupSubMenuMenuItem = new Lang.Class({
if (symbol == Clutter.KEY_Right) { if (symbol == Clutter.KEY_Right) {
this._setOpenState(true); this._setOpenState(true);
this.menu.actor.navigate_focus(null, Gtk.DirectionType.DOWN, false); this.menu.actor.navigate_focus(null, Gtk.DirectionType.DOWN, false);
return true; return Clutter.EVENT_STOP;
} else if (symbol == Clutter.KEY_Left && this._getOpenState()) { } else if (symbol == Clutter.KEY_Left && this._getOpenState()) {
this._setOpenState(false); this._setOpenState(false);
return true; return Clutter.EVENT_STOP;
} }
return this.parent(actor, event); return this.parent(actor, event);
@ -1071,6 +1071,7 @@ const PopupSubMenuMenuItem = new Lang.Class({
_onButtonReleaseEvent: function(actor) { _onButtonReleaseEvent: function(actor) {
this._setOpenState(!this._getOpenState()); this._setOpenState(!this._getOpenState());
return Clutter.EVENT_PROPAGATE;
} }
}); });
@ -1102,7 +1103,7 @@ const PopupMenuManager = new Lang.Class({
if (source) { if (source) {
if (!menu.blockSourceEvents) if (!menu.blockSourceEvents)
this._grabHelper.addActor(source); this._grabHelper.addActor(source);
menudata.enterId = source.connect('enter-event', Lang.bind(this, function() { this._onMenuSourceEnter(menu); })); menudata.enterId = source.connect('enter-event', Lang.bind(this, function() { return this._onMenuSourceEnter(menu); }));
menudata.focusInId = source.connect('key-focus-in', Lang.bind(this, function() { this._onMenuSourceEnter(menu); })); menudata.focusInId = source.connect('key-focus-in', Lang.bind(this, function() { this._onMenuSourceEnter(menu); }));
} }
@ -1164,13 +1165,13 @@ const PopupMenuManager = new Lang.Class({
_onMenuSourceEnter: function(menu) { _onMenuSourceEnter: function(menu) {
if (!this._grabHelper.grabbed) if (!this._grabHelper.grabbed)
return false; return Clutter.EVENT_PROPAGATE;
if (this._grabHelper.isActorGrabbed(menu.actor)) if (this._grabHelper.isActorGrabbed(menu.actor))
return false; return Clutter.EVENT_PROPAGATE;
this._changeMenu(menu); this._changeMenu(menu);
return false; return Clutter.EVENT_PROPAGATE;
}, },
_onMenuDestroy: function(menu) { _onMenuDestroy: function(menu) {

View File

@ -128,7 +128,7 @@ const RunDialog = new Lang.Class({
!this.pushModal()) !this.pushModal())
this.close(); this.close();
return true; return Clutter.EVENT_STOP;
} }
if (symbol == Clutter.Tab) { if (symbol == Clutter.Tab) {
let text = o.get_text(); let text = o.get_text();
@ -142,9 +142,9 @@ const RunDialog = new Lang.Class({
o.insert_text(postfix, -1); o.insert_text(postfix, -1);
o.set_cursor_position(text.length + postfix.length); o.set_cursor_position(text.length + postfix.length);
} }
return true; return Clutter.EVENT_STOP;
} }
return false; return Clutter.EVENT_PROPAGATE;
})); }));
}, },

View File

@ -669,11 +669,11 @@ const ScreenShield = new Lang.Class({
// down after cancel. // down after cancel.
if (this._lockScreenState != MessageTray.State.SHOWN) if (this._lockScreenState != MessageTray.State.SHOWN)
return false; return Clutter.EVENT_PROPAGATE;
let isEnter = (symbol == Clutter.KEY_Return || symbol == Clutter.KEY_KP_Enter); let isEnter = (symbol == Clutter.KEY_Return || symbol == Clutter.KEY_KP_Enter);
if (!isEnter && !(GLib.unichar_isprint(unichar) || symbol == Clutter.KEY_Escape)) if (!isEnter && !(GLib.unichar_isprint(unichar) || symbol == Clutter.KEY_Escape))
return false; return Clutter.EVENT_PROPAGATE;
if (this._isLocked && if (this._isLocked &&
this._ensureUnlockDialog(true, true) && this._ensureUnlockDialog(true, true) &&
@ -681,12 +681,12 @@ const ScreenShield = new Lang.Class({
this._dialog.addCharacter(unichar); this._dialog.addCharacter(unichar);
this._liftShield(true, 0); this._liftShield(true, 0);
return true; return Clutter.EVENT_STOP;
}, },
_onLockScreenScroll: function(actor, event) { _onLockScreenScroll: function(actor, event) {
if (this._lockScreenState != MessageTray.State.SHOWN) if (this._lockScreenState != MessageTray.State.SHOWN)
return false; return Clutter.EVENT_PROPAGATE;
let delta = 0; let delta = 0;
if (event.get_scroll_direction() == Clutter.ScrollDirection.UP) if (event.get_scroll_direction() == Clutter.ScrollDirection.UP)
@ -701,7 +701,7 @@ const ScreenShield = new Lang.Class({
this._liftShield(true, 0); this._liftShield(true, 0);
} }
return true; return Clutter.EVENT_STOP;
}, },
_inhibitSuspend: function() { _inhibitSuspend: function() {
@ -1097,7 +1097,7 @@ const ScreenShield = new Lang.Class({
global.stage.disconnect(motionId); global.stage.disconnect(motionId);
} }
return false; return Clutter.EVENT_PROPAGATE;
})); }));
this._cursorTracker.set_pointer_visible(false); this._cursorTracker.set_pointer_visible(false);

View File

@ -206,12 +206,12 @@ const SelectArea = new Lang.Class({
if (event.get_key_symbol() == Clutter.Escape) if (event.get_key_symbol() == Clutter.Escape)
this._destroy(null, false); this._destroy(null, false);
return; return Clutter.EVENT_PROPAGATE;
}, },
_onMotionEvent: function(actor, event) { _onMotionEvent: function(actor, event) {
if (this._startX == -1 || this._startY == -1) if (this._startX == -1 || this._startY == -1)
return false; return Clutter.EVENT_PROPAGATE;
[this._lastX, this._lastY] = event.get_coords(); [this._lastX, this._lastY] = event.get_coords();
let geometry = this._getGeometry(); let geometry = this._getGeometry();
@ -219,19 +219,19 @@ const SelectArea = new Lang.Class({
this._rubberband.set_position(geometry.x, geometry.y); this._rubberband.set_position(geometry.x, geometry.y);
this._rubberband.set_size(geometry.width, geometry.height); this._rubberband.set_size(geometry.width, geometry.height);
return false; return Clutter.EVENT_PROPAGATE;
}, },
_onButtonPress: function(actor, event) { _onButtonPress: function(actor, event) {
[this._startX, this._startY] = event.get_coords(); [this._startX, this._startY] = event.get_coords();
this._rubberband.set_position(this._startX, this._startY); this._rubberband.set_position(this._startX, this._startY);
return false; return Clutter.EVENT_PROPAGATE;
}, },
_onButtonRelease: function(actor, event) { _onButtonRelease: function(actor, event) {
this._destroy(this._getGeometry(), true); this._destroy(this._getGeometry(), true);
return false; return Clutter.EVENT_PROPAGATE;
}, },
_destroy: function(geometry, fade) { _destroy: function(geometry, fade) {

View File

@ -132,14 +132,14 @@ function _setMenuAlignment(entry, stageX) {
function _onButtonPressEvent(actor, event, entry) { function _onButtonPressEvent(actor, event, entry) {
if (entry.menu.isOpen) { if (entry.menu.isOpen) {
entry.menu.close(BoxPointer.PopupAnimation.FULL); entry.menu.close(BoxPointer.PopupAnimation.FULL);
return true; return Clutter.EVENT_STOP;
} else if (event.get_button() == 3) { } else if (event.get_button() == 3) {
let [stageX, stageY] = event.get_coords(); let [stageX, stageY] = event.get_coords();
_setMenuAlignment(entry, stageX); _setMenuAlignment(entry, stageX);
entry.menu.open(BoxPointer.PopupAnimation.FULL); entry.menu.open(BoxPointer.PopupAnimation.FULL);
return true; return Clutter.EVENT_STOP;
} }
return false; return Clutter.EVENT_PROPAGATE;
}; };
function _onPopup(actor, entry) { function _onPopup(actor, entry) {

View File

@ -111,12 +111,12 @@ const Slider = new Lang.Class({
}, },
_startDragging: function(actor, event) { _startDragging: function(actor, event) {
this.startDragging(event); return this.startDragging(event);
}, },
startDragging: function(event) { startDragging: function(event) {
if (this._dragging) if (this._dragging)
return false; return Clutter.EVENT_PROPAGATE;
this._dragging = true; this._dragging = true;
@ -129,7 +129,7 @@ const Slider = new Lang.Class({
let absX, absY; let absX, absY;
[absX, absY] = event.get_coords(); [absX, absY] = event.get_coords();
this._moveHandle(absX, absY); this._moveHandle(absX, absY);
return true; return Clutter.EVENT_STOP;
}, },
_endDragging: function() { _endDragging: function() {
@ -143,7 +143,7 @@ const Slider = new Lang.Class({
this.emit('drag-end'); this.emit('drag-end');
} }
return true; return Clutter.EVENT_STOP;
}, },
scroll: function(event) { scroll: function(event) {
@ -151,7 +151,7 @@ const Slider = new Lang.Class({
let delta; let delta;
if (event.is_pointer_emulated()) if (event.is_pointer_emulated())
return; return Clutter.EVENT_PROPAGATE;
if (direction == Clutter.ScrollDirection.DOWN) { if (direction == Clutter.ScrollDirection.DOWN) {
delta = -SLIDER_SCROLL_STEP; delta = -SLIDER_SCROLL_STEP;
@ -168,17 +168,18 @@ const Slider = new Lang.Class({
this.actor.queue_repaint(); this.actor.queue_repaint();
this.emit('value-changed', this._value); this.emit('value-changed', this._value);
return Clutter.EVENT_STOP;
}, },
_onScrollEvent: function(actor, event) { _onScrollEvent: function(actor, event) {
this.scroll(event); return this.scroll(event);
}, },
_motionEvent: function(actor, event) { _motionEvent: function(actor, event) {
let absX, absY; let absX, absY;
[absX, absY] = event.get_coords(); [absX, absY] = event.get_coords();
this._moveHandle(absX, absY); this._moveHandle(absX, absY);
return true; return Clutter.EVENT_STOP;
}, },
onKeyPressEvent: function (actor, event) { onKeyPressEvent: function (actor, event) {
@ -189,9 +190,9 @@ const Slider = new Lang.Class({
this.actor.queue_repaint(); this.actor.queue_repaint();
this.emit('value-changed', this._value); this.emit('value-changed', this._value);
this.emit('drag-end'); this.emit('drag-end');
return true; return Clutter.EVENT_STOP;
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_moveHandle: function(absX, absY) { _moveHandle: function(absX, absY) {

View File

@ -48,7 +48,7 @@ const Indicator = new Lang.Class({
this._item.actor.add(icon); this._item.actor.add(icon);
this._item.actor.add(this._slider.actor, { expand: true }); this._item.actor.add(this._slider.actor, { expand: true });
this._item.actor.connect('button-press-event', Lang.bind(this, function(actor, event) { this._item.actor.connect('button-press-event', Lang.bind(this, function(actor, event) {
this._slider.startDragging(event); return this._slider.startDragging(event);
})); }));
this._item.actor.connect('key-press-event', Lang.bind(this, function(actor, event) { this._item.actor.connect('key-press-event', Lang.bind(this, function(actor, event) {
return this._slider.onKeyPressEvent(actor, event); return this._slider.onKeyPressEvent(actor, event);

View File

@ -81,7 +81,7 @@ const AltSwitcher = new Lang.Class({
this._sync(); this._sync();
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
}); });

View File

@ -42,7 +42,7 @@ const StreamSlider = new Lang.Class({
this.item.actor.add(this._icon); this.item.actor.add(this._icon);
this.item.actor.add(this._slider.actor, { expand: true }); this.item.actor.add(this._slider.actor, { expand: true });
this.item.actor.connect('button-press-event', Lang.bind(this, function(actor, event) { this.item.actor.connect('button-press-event', Lang.bind(this, function(actor, event) {
this._slider.startDragging(event); return this._slider.startDragging(event);
})); }));
this.item.actor.connect('key-press-event', Lang.bind(this, function(actor, event) { this.item.actor.connect('key-press-event', Lang.bind(this, function(actor, event) {
return this._slider.onKeyPressEvent(actor, event); return this._slider.onKeyPressEvent(actor, event);
@ -94,7 +94,7 @@ const StreamSlider = new Lang.Class({
}, },
scroll: function(event) { scroll: function(event) {
this._slider.scroll(event); return this._slider.scroll(event);
}, },
setValue: function(value) { setValue: function(value) {
@ -276,7 +276,7 @@ const VolumeMenu = new Lang.Class({
}, },
scroll: function(event) { scroll: function(event) {
this._output.scroll(event); return this._output.scroll(event);
}, },
_onControlStateChanged: function() { _onControlStateChanged: function() {
@ -329,6 +329,6 @@ const Indicator = new Lang.Class({
}, },
_onScrollEvent: function(actor, event) { _onScrollEvent: function(actor, event) {
this._volumeMenu.scroll(event); return this._volumeMenu.scroll(event);
} }
}); });

View File

@ -194,7 +194,7 @@ const SwitcherPopup = new Lang.Class({
else else
this._keyPressHandler(keysym, backwards, action); this._keyPressHandler(keysym, backwards, action);
return true; return Clutter.EVENT_STOP;
}, },
_keyReleaseEvent: function(actor, event) { _keyReleaseEvent: function(actor, event) {
@ -204,11 +204,12 @@ const SwitcherPopup = new Lang.Class({
if (state == 0) if (state == 0)
this._finish(event.get_time()); this._finish(event.get_time());
return true; return Clutter.EVENT_STOP;
}, },
_clickedOutside: function(actor, event) { _clickedOutside: function(actor, event) {
this.destroy(); this.destroy();
return Clutter.EVENT_PROPAGATE;
}, },
_scrollHandler: function(direction) { _scrollHandler: function(direction) {
@ -220,6 +221,7 @@ const SwitcherPopup = new Lang.Class({
_scrollEvent: function(actor, event) { _scrollEvent: function(actor, event) {
this._scrollHandler(event.get_scroll_direction()); this._scrollHandler(event.get_scroll_direction());
return Clutter.EVENT_PROPAGATE;
}, },
_itemActivatedHandler: function(n) { _itemActivatedHandler: function(n) {
@ -403,6 +405,7 @@ const SwitcherList = new Lang.Class({
_onItemEnter: function (index) { _onItemEnter: function (index) {
this._itemEntered(index); this._itemEntered(index);
return Clutter.EVENT_PROPAGATE;
}, },
highlight: function(index, justOutline) { highlight: function(index, justOutline) {

View File

@ -268,7 +268,7 @@ const ViewSelector = new Lang.Class({
// Ignore events while anything but the overview has // Ignore events while anything but the overview has
// pushed a modal (system modals, looking glass, ...) // pushed a modal (system modals, looking glass, ...)
if (Main.modalCount > 1) if (Main.modalCount > 1)
return false; return Clutter.EVENT_PROPAGATE;
let modifiers = event.get_state(); let modifiers = event.get_state();
let symbol = event.get_key_symbol(); let symbol = event.get_key_symbol();
@ -280,11 +280,11 @@ const ViewSelector = new Lang.Class({
this._showAppsButton.checked = false; this._showAppsButton.checked = false;
else else
Main.overview.hide(); Main.overview.hide();
return true; return Clutter.EVENT_STOP;
} else if (this._shouldTriggerSearch(symbol)) { } else if (this._shouldTriggerSearch(symbol)) {
this.startSearch(event); this.startSearch(event);
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_searchCancelled: function() { _searchCancelled: function() {
@ -400,7 +400,7 @@ const ViewSelector = new Lang.Class({
if (symbol == Clutter.Escape) { if (symbol == Clutter.Escape) {
if (this._isActivated()) { if (this._isActivated()) {
this.reset(); this.reset();
return true; return Clutter.EVENT_STOP;
} }
} else if (this._searchActive) { } else if (this._searchActive) {
let arrowNext, nextDirection; let arrowNext, nextDirection;
@ -414,18 +414,18 @@ const ViewSelector = new Lang.Class({
if (symbol == Clutter.Tab) { if (symbol == Clutter.Tab) {
this._searchResults.navigateFocus(Gtk.DirectionType.TAB_FORWARD); this._searchResults.navigateFocus(Gtk.DirectionType.TAB_FORWARD);
return true; return Clutter.EVENT_STOP;
} else if (symbol == Clutter.ISO_Left_Tab) { } else if (symbol == Clutter.ISO_Left_Tab) {
this._focusTrap.can_focus = false; this._focusTrap.can_focus = false;
this._searchResults.navigateFocus(Gtk.DirectionType.TAB_BACKWARD); this._searchResults.navigateFocus(Gtk.DirectionType.TAB_BACKWARD);
this._focusTrap.can_focus = true; this._focusTrap.can_focus = true;
return true; return Clutter.EVENT_STOP;
} else if (symbol == Clutter.Down) { } else if (symbol == Clutter.Down) {
this._searchResults.navigateFocus(Gtk.DirectionType.DOWN); this._searchResults.navigateFocus(Gtk.DirectionType.DOWN);
return true; return Clutter.EVENT_STOP;
} else if (symbol == arrowNext && this._text.position == -1) { } else if (symbol == arrowNext && this._text.position == -1) {
this._searchResults.navigateFocus(nextDirection); this._searchResults.navigateFocus(nextDirection);
return true; return Clutter.EVENT_STOP;
} else if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) { } else if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) {
// We can't connect to 'activate' here because search providers // We can't connect to 'activate' here because search providers
// might want to do something with the modifiers in activateDefault. // might want to do something with the modifiers in activateDefault.
@ -434,10 +434,10 @@ const ViewSelector = new Lang.Class({
this._doSearch(); this._doSearch();
} }
this._searchResults.activateDefault(); this._searchResults.activateDefault();
return true; return Clutter.EVENT_STOP;
} }
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_onCapturedEvent: function(actor, event) { _onCapturedEvent: function(actor, event) {
@ -452,7 +452,7 @@ const ViewSelector = new Lang.Class({
} }
} }
return false; return Clutter.EVENT_PROPAGATE;
}, },
_doSearch: function () { _doSearch: function () {

View File

@ -537,15 +537,17 @@ const WindowOverlay = new Lang.Class({
// as the close button will be shown as needed when the overlays // as the close button will be shown as needed when the overlays
// are shown again // are shown again
if (this._hidden) if (this._hidden)
return; return Clutter.EVENT_PROPAGATE;
this._animateVisible(); this._animateVisible();
this.emit('show-close-button'); this.emit('show-close-button');
return Clutter.EVENT_PROPAGATE;
}, },
_onLeave: function() { _onLeave: function() {
if (this._idleToggleCloseId == 0) if (this._idleToggleCloseId == 0)
this._idleToggleCloseId = Mainloop.timeout_add(750, Lang.bind(this, this._idleToggleCloseButton)); this._idleToggleCloseId = Mainloop.timeout_add(750, Lang.bind(this, this._idleToggleCloseButton));
return Clutter.EVENT_PROPAGATE;
}, },
_idleToggleCloseButton: function() { _idleToggleCloseButton: function() {

View File

@ -131,7 +131,7 @@ const WindowClone = new Lang.Class({
_onButtonRelease : function (actor, event) { _onButtonRelease : function (actor, event) {
this.emit('selected', event.get_time()); this.emit('selected', event.get_time());
return true; return Clutter.EVENT_STOP;
}, },
_onDragBegin : function (draggable, time) { _onDragBegin : function (draggable, time) {
@ -562,7 +562,7 @@ const ThumbnailsBox = new Lang.Class({
this._thumbnails = []; this._thumbnails = [];
this.actor.connect('button-press-event', function() { return true; }); this.actor.connect('button-press-event', function() { return Clutter.EVENT_STOP; });
this.actor.connect('button-release-event', Lang.bind(this, this._onButtonRelease)); this.actor.connect('button-release-event', Lang.bind(this, this._onButtonRelease));
Main.overview.connect('showing', Main.overview.connect('showing',
@ -607,7 +607,7 @@ const ThumbnailsBox = new Lang.Class({
} }
} }
return true; return Clutter.EVENT_STOP;
}, },
_onDragBegin: function() { _onDragBegin: function() {

View File

@ -614,7 +614,7 @@ const WorkspacesDisplay = new Lang.Class({
_onScrollEvent: function(actor, event) { _onScrollEvent: function(actor, event) {
if (!this.actor.mapped) if (!this.actor.mapped)
return false; return Clutter.EVENT_PROPAGATE;
let activeWs = global.screen.get_active_workspace(); let activeWs = global.screen.get_active_workspace();
let ws; let ws;
switch (event.get_scroll_direction()) { switch (event.get_scroll_direction()) {
@ -625,10 +625,10 @@ const WorkspacesDisplay = new Lang.Class({
ws = activeWs.get_neighbor(Meta.MotionDirection.DOWN); ws = activeWs.get_neighbor(Meta.MotionDirection.DOWN);
break; break;
default: default:
return false; return Clutter.EVENT_PROPAGATE;
} }
Main.wm.actionMoveWorkspace(ws); Main.wm.actionMoveWorkspace(ws);
return true; return Clutter.EVENT_STOP;
} }
}); });
Signals.addSignalMethods(WorkspacesDisplay.prototype); Signals.addSignalMethods(WorkspacesDisplay.prototype);