[gnome-shell] appDisplay: Add :gesture-modes property
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] appDisplay: Add :gesture-modes property
- Date: Wed, 12 May 2021 17:25:29 +0000 (UTC)
commit 803b944ffd57a8050fa6c9337708f9d3851b4b60
Author: Florian Müllner <fmuellner gnome org>
Date: Tue May 11 16:44:29 2021 +0200
appDisplay: Add :gesture-modes property
Both the main app grid and folders got a swipe tracker, which is
active in both OVERVIEW and POPUP mode. The result is that two
trackers fight over the same events, and everybody loses.
Address this by adding a :gesture-modes property that determines
the allowed modes for the associated swipe tracker.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4256
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1844>
js/ui/appDisplay.js | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 39f440127b..f86a7bb678 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -131,6 +131,12 @@ function _findBestFolderName(apps) {
var BaseAppView = GObject.registerClass({
GTypeFlags: GObject.TypeFlags.ABSTRACT,
+ Properties: {
+ 'gesture-modes': GObject.ParamSpec.flags(
+ 'gesture-modes', 'gesture-modes', 'gesture-modes',
+ GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
+ Shell.ActionMode, Shell.ActionMode.OVERVIEW),
+ },
Signals: {
'view-loaded': {},
},
@@ -281,8 +287,7 @@ var BaseAppView = GObject.registerClass({
// Swipe
this._swipeTracker = new SwipeTracker.SwipeTracker(this._scrollView,
- Clutter.Orientation.HORIZONTAL,
- Shell.ActionMode.OVERVIEW | Shell.ActionMode.POPUP);
+ Clutter.Orientation.HORIZONTAL, this.gestureModes);
this._swipeTracker.orientation = Clutter.Orientation.HORIZONTAL;
this._swipeTracker.connect('begin', this._swipeBegin.bind(this));
this._swipeTracker.connect('update', this._swipeUpdate.bind(this));
@@ -2196,6 +2201,7 @@ class FolderView extends BaseAppView {
layout_manager: new Clutter.BinLayout(),
x_expand: true,
y_expand: true,
+ gesture_modes: Shell.ActionMode.POPUP,
});
// If it not expand, the parent doesn't take into account its preferred_width when allocating
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]