inhibitShortcutsDialog: Stop using GTK to display shortcut
Instead, switch to the corresponding mutter API. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2676>
This commit is contained in:
parent
89106c1f0a
commit
e702641f41
@ -1,12 +1,10 @@
|
|||||||
/* exported InhibitShortcutsDialog */
|
/* exported InhibitShortcutsDialog */
|
||||||
const {Clutter, Gio, GObject, Gtk, Meta, Pango, Shell, St} = imports.gi;
|
const {Clutter, GObject, Meta, Pango, Shell, St} = imports.gi;
|
||||||
|
|
||||||
const Dialog = imports.ui.dialog;
|
const Dialog = imports.ui.dialog;
|
||||||
const ModalDialog = imports.ui.modalDialog;
|
const ModalDialog = imports.ui.modalDialog;
|
||||||
const PermissionStore = imports.misc.permissionStore;
|
const PermissionStore = imports.misc.permissionStore;
|
||||||
|
|
||||||
const WAYLAND_KEYBINDINGS_SCHEMA = 'org.gnome.mutter.wayland.keybindings';
|
|
||||||
|
|
||||||
const APP_ALLOWLIST = ['org.gnome.Settings.desktop'];
|
const APP_ALLOWLIST = ['org.gnome.Settings.desktop'];
|
||||||
const APP_PERMISSIONS_TABLE = 'gnome';
|
const APP_PERMISSIONS_TABLE = 'gnome';
|
||||||
const APP_PERMISSIONS_ID = 'shortcuts-inhibitor';
|
const APP_PERMISSIONS_ID = 'shortcuts-inhibitor';
|
||||||
@ -42,13 +40,6 @@ var InhibitShortcutsDialog = GObject.registerClass({
|
|||||||
return windowTracker.get_window_app(this._window);
|
return windowTracker.get_window_app(this._window);
|
||||||
}
|
}
|
||||||
|
|
||||||
_getRestoreAccel() {
|
|
||||||
let settings = new Gio.Settings({ schema_id: WAYLAND_KEYBINDINGS_SCHEMA });
|
|
||||||
let accel = settings.get_strv('restore-shortcuts')[0] || '';
|
|
||||||
return Gtk.accelerator_get_label.apply(null,
|
|
||||||
Gtk.accelerator_parse(accel));
|
|
||||||
}
|
|
||||||
|
|
||||||
_shouldUsePermStore() {
|
_shouldUsePermStore() {
|
||||||
return this._app && !this._app.is_window_backed();
|
return this._app && !this._app.is_window_backed();
|
||||||
}
|
}
|
||||||
@ -79,7 +70,7 @@ var InhibitShortcutsDialog = GObject.registerClass({
|
|||||||
: _('An app wants to inhibit shortcuts'),
|
: _('An app wants to inhibit shortcuts'),
|
||||||
});
|
});
|
||||||
|
|
||||||
let restoreAccel = this._getRestoreAccel();
|
const restoreAccel = Meta.prefs_get_keybinding_label('restore-shortcuts');
|
||||||
if (restoreAccel) {
|
if (restoreAccel) {
|
||||||
let restoreLabel = new St.Label({
|
let restoreLabel = new St.Label({
|
||||||
/* Translators: %s is a keyboard shortcut like "Super+x" */
|
/* Translators: %s is a keyboard shortcut like "Super+x" */
|
||||||
|
Loading…
Reference in New Issue
Block a user