summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2018-05-24 17:28:36 +0200
committerFlorian Müllner <florian.muellner@gmail.com>2018-07-14 18:38:16 +0000
commit905801b178fffa13cf1161b1ccfc8b1202f97efc (patch)
tree6129140602bffe3af6b096e476911c0c269a8a13
parent4a7082bb0f3ec8f8cc4a200aa974aa20de379f8f (diff)
downloadgnome-shell-wip/fmuellner/touch-panel-drag.tar.gz
panel: Allow restoring maximized/tiled windows by touchwip/fmuellner/touch-panel-drag
Maximized and tiled windows can be restored with a drag gesture, not only from their titlebars, but also from any non-reactive parts of the top bar above the window. Currently this only works for actual pointer devices, extend the behavior to handle touch as well. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/112
-rw-r--r--js/ui/panel.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 8537cb51a..6f3ac9cb3 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -797,6 +797,7 @@ var Panel = new Lang.Class({
this.actor.connect('get-preferred-height', this._getPreferredHeight.bind(this));
this.actor.connect('allocate', this._allocate.bind(this));
this.actor.connect('button-press-event', this._onButtonPress.bind(this));
+ this.actor.connect('touch-event', this._onButtonPress.bind(this));
this.actor.connect('key-press-event', this._onKeyPress.bind(this));
Main.overview.connect('showing', () => {
@@ -940,8 +941,13 @@ var Panel = new Lang.Class({
if (event.get_source() != actor)
return Clutter.EVENT_PROPAGATE;
- let button = event.get_button();
- if (button != 1)
+ let type = event.type();
+ let isPress = type == Clutter.EventType.BUTTON_PRESS;
+ if (!isPress && type != Clutter.EventType.TOUCH_BEGIN)
+ return Clutter.EVENT_PROPAGATE;
+
+ let button = isPress ? event.get_button() : -1;
+ if (isPress && button != 1)
return Clutter.EVENT_PROPAGATE;
let focusWindow = global.display.focus_window;