Blame SOURCES/0001-gesture-inhibitor-Put-a-foot-down-with-self-enabling.patch

b86695
From dfdd10b46d670674d5e0e38f7adcd007f5884822 Mon Sep 17 00:00:00 2001
b86695
From: rpm-build <rpm-build>
b86695
Date: Wed, 29 Sep 2021 14:33:25 +0200
b86695
Subject: [PATCH] gesture-inhibitor: Put a foot down with self-enabling
b86695
 gestures
b86695
b86695
If a gesture (unfullscreen, I'm looking at you) controls its 'enabled'
b86695
property, it will bypass the will of this extension. Make it sure that
b86695
gestures are forced-off if the extension says so.
b86695
---
b86695
 extensions/gesture-inhibitor/extension.js | 8 +++++++-
b86695
 1 file changed, 7 insertions(+), 1 deletion(-)
b86695
b86695
diff --git a/extensions/gesture-inhibitor/extension.js b/extensions/gesture-inhibitor/extension.js
b86695
index e74ede2..66c706e 100644
b86695
--- a/extensions/gesture-inhibitor/extension.js
b86695
+++ b/extensions/gesture-inhibitor/extension.js
b86695
@@ -59,13 +59,19 @@ class Extension {
b86695
     enable() {
b86695
 	this._map.forEach(m => {
b86695
 	    this._settings.bind(m.setting, m.action, 'enabled',
b86695
-				Gio.SettingsBindFlags.DEFAULT);
b86695
+				Gio.SettingsBindFlags.GET);
b86695
+            m.handler = m.action.connect('notify::enabled', () => {
b86695
+                if (m.action.enabled && !this._settings.get_boolean(m.setting))
b86695
+                    m.action.enabled = this._settings.get_boolean(m.setting);
b86695
+            });
b86695
 	});
b86695
     }
b86695
 
b86695
     disable() {
b86695
 	this._map.forEach(m => {
b86695
 	    m.action.enabled = true;
b86695
+            if (m.handler > 0)
b86695
+                m.action.disconnect(m.handler);
b86695
 	});
b86695
     }
b86695
 }
b86695
-- 
b86695
2.31.1
b86695