(extension)
| 16 | |
| 17 | let keybindSettings; |
| 18 | export function enable(extension) { |
| 19 | // restore previous keybinds (in case failed to restore last time, e.g. gnome crash etc) |
| 20 | Settings.updateOverrides(); |
| 21 | |
| 22 | keybindSettings = extension.getSettings(KEYBINDINGS_KEY); |
| 23 | setupActions(keybindSettings); |
| 24 | signals.connect(display, 'accelerator-activated', (display, actionId, deviceId, timestamp) => { |
| 25 | handleAccelerator(display, actionId, deviceId, timestamp); |
| 26 | }); |
| 27 | actions.forEach(enableAction); |
| 28 | Settings.overrideConflicts(); |
| 29 | |
| 30 | let schemas = [...Settings.getConflictSettings(), extension.getSettings(KEYBINDINGS_KEY)]; |
| 31 | schemas.forEach(schema => { |
| 32 | signals.connect(schema, 'changed', (settings, key) => { |
| 33 | const numConflicts = Settings.conflictKeyChanged(settings, key); |
| 34 | if (numConflicts > 0) { |
| 35 | Main.notifyError( |
| 36 | `PaperWM: overriding '${key}' keybind`, |
| 37 | `this Gnome Keybind will be restored when PaperWM is disabled`); |
| 38 | } |
| 39 | }); |
| 40 | }); |
| 41 | } |
| 42 | |
| 43 | export function disable() { |
| 44 | signals.destroy(); |
nothing calls this directly
no test coverage detected