@@ -24,22 +24,6 @@ function setState($, key) {
24
24
prefs [ name ] = value . deep_unpack ( ) ;
25
25
}
26
26
27
- var conflictSettings ; // exported
28
- function getConflictSettings ( ) {
29
- if ( ! conflictSettings ) {
30
- // Schemas that may contain conflicting keybindings
31
- // It's possible to inject or remove settings here on `user.init`.
32
- conflictSettings = [
33
- new Gio . Settings ( { schema_id : 'org.gnome.mutter.keybindings' } ) ,
34
- new Gio . Settings ( { schema_id : 'org.gnome.mutter.wayland.keybindings' } ) ,
35
- new Gio . Settings ( { schema_id : "org.gnome.desktop.wm.keybindings" } ) ,
36
- new Gio . Settings ( { schema_id : "org.gnome.shell.keybindings" } ) ,
37
- ] ;
38
- }
39
-
40
- return conflictSettings ;
41
- }
42
-
43
27
var prefs ;
44
28
let gsettings , _overriddingConflicts ;
45
29
function enable ( ) {
@@ -88,6 +72,40 @@ function disable() {
88
72
conflictSettings = null ;
89
73
}
90
74
75
+ var conflictSettings ; // exported
76
+ function getConflictSettings ( ) {
77
+ if ( ! conflictSettings ) {
78
+ // Schemas that may contain conflicting keybindings
79
+ conflictSettings = [ ] ;
80
+ addSchemaToConflictSettings ( 'org.gnome.mutter.keybindings' ) ;
81
+ addSchemaToConflictSettings ( 'org.gnome.mutter.wayland.keybindings' ) ;
82
+ addSchemaToConflictSettings ( 'org.gnome.desktop.wm.keybindings' ) ;
83
+ addSchemaToConflictSettings ( 'org.gnome.shell.keybindings' ) ;
84
+
85
+ // below schemas are checked but may not exist in all distributions
86
+ addSchemaToConflictSettings ( 'org.gnome.settings-daemon.plugins.media-keys' , false ) ;
87
+ // ubuntu tiling-assistant (enabled by default on Ubuntu 23.10)
88
+ addSchemaToConflictSettings ( 'org.gnome.shell.extensions.tiling-assistant' , false ) ;
89
+ }
90
+
91
+ return conflictSettings ;
92
+ }
93
+
94
+ /**
95
+ * Adds a Gio.Settings object to conflictSettings. Fails gracefully.
96
+ * @param {Gio.Settings } schemaId
97
+ */
98
+ function addSchemaToConflictSettings ( schemaId , warn = true ) {
99
+ try {
100
+ conflictSettings . push ( new Gio . Settings ( { schema_id : schemaId } ) ) ;
101
+ }
102
+ catch ( e ) {
103
+ if ( warn ) {
104
+ console . warn ( `Invalid schema_id '${ schemaId } ': could not add to keybind conflict checks` ) ;
105
+ }
106
+ }
107
+ }
108
+
91
109
// / Keybindings
92
110
93
111
function accelerator_parse ( keystr ) {
0 commit comments