Adjust gesture-inhibitor to GNOME 40 changes

Resolves: #2013196
This commit is contained in:
Florian Müllner 2021-10-20 20:01:55 +02:00
parent 5363aa6828
commit 3a8786c0af
2 changed files with 168 additions and 2 deletions

View File

@ -1,7 +1,7 @@
From e27d37b9efed5f1266c6b27520a4698e9eb9d453 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Thu, 28 Jan 2021 00:06:12 +0100
Subject: [PATCH] Add gesture-inhibitor extension
Subject: [PATCH 1/3] Add gesture-inhibitor extension
This extension may disable default GNOME Shell gestures.
---
@ -184,3 +184,165 @@ index 78dee5b8..1bbda801 100644
--
2.32.0
From 40604aa25af5a12c976b0ccdbd872bf48c49fdcf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 20 Oct 2021 19:48:46 +0200
Subject: [PATCH 2/3] gesture-inhibitor: Fix up indentation
---
extensions/gesture-inhibitor/extension.js | 59 +++++++++++------------
1 file changed, 29 insertions(+), 30 deletions(-)
diff --git a/extensions/gesture-inhibitor/extension.js b/extensions/gesture-inhibitor/extension.js
index e74ede2f..734d61cc 100644
--- a/extensions/gesture-inhibitor/extension.js
+++ b/extensions/gesture-inhibitor/extension.js
@@ -29,44 +29,43 @@ const Gio = imports.gi.Gio;
class Extension {
constructor() {
- this._settings = ExtensionUtils.getSettings();
- let actions = global.stage.get_actions();
+ this._settings = ExtensionUtils.getSettings();
+ let actions = global.stage.get_actions();
- actions.forEach(a => {
- if (a instanceof ViewSelector.ShowOverviewAction)
- this._showOverview = a;
- else if (a instanceof WindowManager.AppSwitchAction)
- this._appSwitch = a;
- else if (a instanceof EdgeDragAction.EdgeDragAction &&
- a._side == St.Side.BOTTOM)
- this._showOsk = a;
- else if (a instanceof EdgeDragAction.EdgeDragAction &&
- a._side == St.Side.TOP)
- this._unfullscreen = a;
- else if (a instanceof EdgeDragAction.EdgeDragAction)
- this._showAppGrid = a;
- });
+ actions.forEach(a => {
+ if (a instanceof ViewSelector.ShowOverviewAction)
+ this._showOverview = a;
+ else if (a instanceof WindowManager.AppSwitchAction)
+ this._appSwitch = a;
+ else if (a instanceof EdgeDragAction.EdgeDragAction &&
+ a._side == St.Side.BOTTOM)
+ this._showOsk = a;
+ else if (a instanceof EdgeDragAction.EdgeDragAction &&
+ a._side == St.Side.TOP)
+ this._unfullscreen = a;
+ else if (a instanceof EdgeDragAction.EdgeDragAction)
+ this._showAppGrid = a;
+ });
- this._map = [
- { setting: 'overview', action: this._showOverview },
- { setting: 'app-switch', action: this._appSwitch },
- { setting: 'show-osk', action: this._showOsk },
- { setting: 'unfullscreen', action: this._unfullscreen },
- { setting: 'show-app-grid', action: this._showAppGrid }
- ];
+ this._map = [
+ { setting: 'overview', action: this._showOverview },
+ { setting: 'app-switch', action: this._appSwitch },
+ { setting: 'show-osk', action: this._showOsk },
+ { setting: 'unfullscreen', action: this._unfullscreen },
+ { setting: 'show-app-grid', action: this._showAppGrid }
+ ];
}
enable() {
- this._map.forEach(m => {
- this._settings.bind(m.setting, m.action, 'enabled',
- Gio.SettingsBindFlags.DEFAULT);
- });
+ this._map.forEach(m => {
+ this._settings.bind(m.setting, m.action, 'enabled',
+ Gio.SettingsBindFlags.DEFAULT);
+ });
}
disable() {
- this._map.forEach(m => {
- m.action.enabled = true;
- });
+ this._map.forEach(
+ m => (m.action.enabled = true));
}
}
--
2.32.0
From 57d53126e322b50f31de169f49bae6e3e01cca21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 20 Oct 2021 19:47:05 +0200
Subject: [PATCH 3/3] gesture-inhibitor: Adjust for GNOME 40 changes
---
extensions/gesture-inhibitor/extension.js | 11 +++--------
...ome.shell.extensions.gesture-inhibitor.gschema.xml | 4 ----
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/extensions/gesture-inhibitor/extension.js b/extensions/gesture-inhibitor/extension.js
index 734d61cc..13586108 100644
--- a/extensions/gesture-inhibitor/extension.js
+++ b/extensions/gesture-inhibitor/extension.js
@@ -21,8 +21,8 @@
const Clutter = imports.gi.Clutter;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
-const ViewSelector = imports.ui.viewSelector;
const EdgeDragAction = imports.ui.edgeDragAction;
+const Main = imports.ui.main;
const WindowManager = imports.ui.windowManager;
const St = imports.gi.St;
const Gio = imports.gi.Gio;
@@ -33,9 +33,7 @@ class Extension {
let actions = global.stage.get_actions();
actions.forEach(a => {
- if (a instanceof ViewSelector.ShowOverviewAction)
- this._showOverview = a;
- else if (a instanceof WindowManager.AppSwitchAction)
+ if (a instanceof WindowManager.AppSwitchAction)
this._appSwitch = a;
else if (a instanceof EdgeDragAction.EdgeDragAction &&
a._side == St.Side.BOTTOM)
@@ -43,16 +41,13 @@ class Extension {
else if (a instanceof EdgeDragAction.EdgeDragAction &&
a._side == St.Side.TOP)
this._unfullscreen = a;
- else if (a instanceof EdgeDragAction.EdgeDragAction)
- this._showAppGrid = a;
});
this._map = [
- { setting: 'overview', action: this._showOverview },
+ { setting: 'overview', action: Main.overview._swipeTracker },
{ setting: 'app-switch', action: this._appSwitch },
{ setting: 'show-osk', action: this._showOsk },
{ setting: 'unfullscreen', action: this._unfullscreen },
- { setting: 'show-app-grid', action: this._showAppGrid }
];
}
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
index 1d67dcc0..4bdf9260 100644
--- a/extensions/gesture-inhibitor/org.gnome.shell.extensions.gesture-inhibitor.gschema.xml
+++ b/extensions/gesture-inhibitor/org.gnome.shell.extensions.gesture-inhibitor.gschema.xml
@@ -1,9 +1,5 @@
<schemalist>
<schema id="org.gnome.shell.extensions.gesture-inhibitor" path="/org/gnome/shell/extensions/gesture-inhibitor/">
- <key name="show-app-grid" type="b">
- <default>true</default>
- <summary>Show app grid gesture</summary>
- </key>
<key name="show-osk" type="b">
<default>true</default>
<summary>Show OSK gesture</summary>
--
2.32.0

View File

@ -7,7 +7,7 @@
Name: gnome-shell-extensions
Version: 40.4
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Modify and extend GNOME Shell functionality and behavior
License: GPLv2+
@ -384,6 +384,10 @@ workspaces.
%changelog
* Wed Oct 20 2021 Florian Müllner <fmuellner@redhat.com> - 40.4-4
- Adjust gesture-inhibitor extension to GNOME 40 changes
Resolves: #2013196
* Wed Oct 20 2021 Florian Müllner <fmuellner@redhat.com> - 40.4-3
- Add gesture-inhibitor extension
Resolves: #2013196