[gnome-shell] workspaceThumbnail: handle scroll-event internally
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] workspaceThumbnail: handle scroll-event internally
- Date: Mon, 17 Dec 2012 12:25:50 +0000 (UTC)
commit 9f98f6f02d74b01a47069506f187726a8610116f
Author: Tanner Doshier <doshitan gmail com>
Date: Wed Jul 25 15:15:26 2012 -0500
workspaceThumbnail: handle scroll-event internally
Instead of having WorkspacesDisplay calling us.
https://bugzilla.gnome.org/show_bug.cgi?id=690175
js/ui/workspaceThumbnail.js | 12 ++++++++++++
js/ui/workspacesView.js | 13 -------------
2 files changed, 12 insertions(+), 13 deletions(-)
---
diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js
index d543f2b..71ea13d 100644
--- a/js/ui/workspaceThumbnail.js
+++ b/js/ui/workspaceThumbnail.js
@@ -544,6 +544,7 @@ const ThumbnailsBox = new Lang.Class({
this.actor.connect('button-press-event', function() { return true; });
this.actor.connect('button-release-event', Lang.bind(this, this._onButtonRelease));
+ this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
Main.overview.connect('item-drag-begin',
Lang.bind(this, this._onDragBegin));
@@ -1203,5 +1204,16 @@ const ThumbnailsBox = new Lang.Class({
},
onCompleteScope: this
});
+ },
+
+ _onScrollEvent: function (actor, event) {
+ switch (event.get_scroll_direction()) {
+ case Clutter.ScrollDirection.UP:
+ Main.wm.actionMoveWorkspace(Meta.MotionDirection.UP);
+ break;
+ case Clutter.ScrollDirection.DOWN:
+ Main.wm.actionMoveWorkspace(Meta.MotionDirection.DOWN);
+ break;
+ }
}
});
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index bd11076..781c0e4 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -493,8 +493,6 @@ const WorkspacesDisplay = new Lang.Class({
controls.track_hover = true;
controls.connect('notify::hover',
Lang.bind(this, this._onControlsHoverChanged));
- controls.connect('scroll-event',
- Lang.bind(this, this._onScrollEvent));
this._primaryIndex = Main.layoutManager.primaryIndex;
@@ -1013,17 +1011,6 @@ const WorkspacesDisplay = new Lang.Class({
// might as well avoid it.
Meta.later_add(Meta.LaterType.BEFORE_REDRAW,
Lang.bind(this, this._updateZoom));
- },
-
- _onScrollEvent: function (actor, event) {
- switch ( event.get_scroll_direction() ) {
- case Clutter.ScrollDirection.UP:
- Main.wm.actionMoveWorkspace(Meta.MotionDirection.UP);
- break;
- case Clutter.ScrollDirection.DOWN:
- Main.wm.actionMoveWorkspace(Meta.MotionDirection.DOWN);
- break;
- }
}
});
Signals.addSignalMethods(WorkspacesDisplay.prototype);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]