Adjust gesture-inhibitor for GNOME 49
The AppSwitchAction gesture was removed, and EdgeDragAction moved to EdgeDragGesture. Related: https://issues.redhat.com/browse/RHEL-124224
This commit is contained in:
parent
9859472936
commit
c2e3fcdf13
@ -1,16 +1,16 @@
|
||||
From 7bdcae3df6bd17d451a041318207a8e32cd86aa0 Mon Sep 17 00:00:00 2001
|
||||
From 66133e38164e7cd12c9bbd7270a872ad8bfeb0bf Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Garnacho <carlosg@gnome.org>
|
||||
Date: Thu, 28 Jan 2021 00:06:12 +0100
|
||||
Subject: [PATCH 1/5] Add gesture-inhibitor extension
|
||||
Subject: [PATCH] Add gesture-inhibitor extension
|
||||
|
||||
This extension may disable default GNOME Shell gestures.
|
||||
---
|
||||
extensions/gesture-inhibitor/extension.js | 79 +++++++++++++++++++
|
||||
extensions/gesture-inhibitor/extension.js | 74 +++++++++++++++++++
|
||||
extensions/gesture-inhibitor/meson.build | 8 ++
|
||||
extensions/gesture-inhibitor/metadata.json.in | 12 +++
|
||||
...l.extensions.gesture-inhibitor.gschema.xml | 25 ++++++
|
||||
...l.extensions.gesture-inhibitor.gschema.xml | 21 ++++++
|
||||
meson.build | 7 +-
|
||||
5 files changed, 130 insertions(+), 1 deletion(-)
|
||||
5 files changed, 121 insertions(+), 1 deletion(-)
|
||||
create mode 100644 extensions/gesture-inhibitor/extension.js
|
||||
create mode 100644 extensions/gesture-inhibitor/meson.build
|
||||
create mode 100644 extensions/gesture-inhibitor/metadata.json.in
|
||||
@ -18,10 +18,10 @@ This extension may disable default GNOME Shell gestures.
|
||||
|
||||
diff --git a/extensions/gesture-inhibitor/extension.js b/extensions/gesture-inhibitor/extension.js
|
||||
new file mode 100644
|
||||
index 00000000..872020ba
|
||||
index 00000000..25c88916
|
||||
--- /dev/null
|
||||
+++ b/extensions/gesture-inhibitor/extension.js
|
||||
@@ -0,0 +1,79 @@
|
||||
@@ -0,0 +1,74 @@
|
||||
+// SPDX-FileCopyrightText: 2021 Carlos Garnacho <carlosg@gnome.org>
|
||||
+//
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
@ -29,13 +29,11 @@ index 00000000..872020ba
|
||||
+
|
||||
+import Clutter from 'gi://Clutter';
|
||||
+import Gio from 'gi://Gio';
|
||||
+import Shell from 'gi://Shell';
|
||||
+import St from 'gi://St';
|
||||
+
|
||||
+import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
+
|
||||
+import {AppSwitchAction} from 'resource:///org/gnome/shell/ui/windowManager.js';
|
||||
+import {EdgeDragAction} from 'resource:///org/gnome/shell/ui/edgeDragAction.js';
|
||||
+
|
||||
+import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
+
|
||||
+export default class GestureInhibitorExtension extends Extension {
|
||||
@ -45,19 +43,16 @@ index 00000000..872020ba
|
||||
+ let actions = global.stage.get_actions();
|
||||
+
|
||||
+ actions.forEach(a => {
|
||||
+ if (a instanceof AppSwitchAction)
|
||||
+ this._appSwitch = a;
|
||||
+ else if (a instanceof EdgeDragAction &&
|
||||
+ if (a instanceof Shell.EdgeDragGesture &&
|
||||
+ a._side === St.Side.BOTTOM)
|
||||
+ this._showOsk = a;
|
||||
+ else if (a instanceof EdgeDragAction &&
|
||||
+ else if (a instanceof Shell.EdgeDragGesture &&
|
||||
+ a._side === St.Side.TOP)
|
||||
+ this._unfullscreen = a;
|
||||
+ });
|
||||
+
|
||||
+ this._map = [
|
||||
+ {setting: 'overview', action: Main.overview._swipeTracker},
|
||||
+ {setting: 'app-switch', action: this._appSwitch},
|
||||
+ {setting: 'show-osk', action: this._showOsk},
|
||||
+ {setting: 'unfullscreen', action: this._unfullscreen},
|
||||
+ {setting: 'workspace-switch', action: Main.wm._workspaceAnimation._swipeTracker},
|
||||
@ -135,10 +130,10 @@ index 00000000..37d6a117
|
||||
+
|
||||
diff --git a/extensions/gesture-inhibitor/org.gnome.shell.extensions.gesture-inhibitor.gschema.xml b/extensions/gesture-inhibitor/org.gnome.shell.extensions.gesture-inhibitor.gschema.xml
|
||||
new file mode 100644
|
||||
index 00000000..b06d027a
|
||||
index 00000000..48ba15df
|
||||
--- /dev/null
|
||||
+++ b/extensions/gesture-inhibitor/org.gnome.shell.extensions.gesture-inhibitor.gschema.xml
|
||||
@@ -0,0 +1,25 @@
|
||||
@@ -0,0 +1,21 @@
|
||||
+<schemalist>
|
||||
+ <schema id="org.gnome.shell.extensions.gesture-inhibitor" path="/org/gnome/shell/extensions/gesture-inhibitor/">
|
||||
+ <key name="show-osk" type="b">
|
||||
@ -149,10 +144,6 @@ index 00000000..b06d027a
|
||||
+ <default>true</default>
|
||||
+ <summary>Show Overview gesture</summary>
|
||||
+ </key>
|
||||
+ <key name="app-switch" type="b">
|
||||
+ <default>true</default>
|
||||
+ <summary>Application switch gesture</summary>
|
||||
+ </key>
|
||||
+ <key name="workspace-switch" type="b">
|
||||
+ <default>true</default>
|
||||
+ <summary>Workspace switch gesture</summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user