From 1da29b04efb1f89834e2bfe581de2f2903c37e89 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Tue, 6 Dec 2022 12:38:48 +0000 Subject: [PATCH] padOsd: Replace Gtk accelerator API usage with Mutter In order to drop the direct dependency of GTK from Mutter in a Wayland only build. The consumer and the producer of the events must be Mutter Depends on https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2407 Part-of: --- js/ui/padOsd.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/js/ui/padOsd.js b/js/ui/padOsd.js index e1e24f70c..2442e98fc 100644 --- a/js/ui/padOsd.js +++ b/js/ui/padOsd.js @@ -3,7 +3,7 @@ const { Atk, Clutter, GDesktopEnums, Gio, - GLib, GObject, Gtk, Meta, Pango, Rsvg, St, + GLib, GObject, Meta, Pango, Rsvg, St, } = imports.gi; const Signals = imports.misc.signals; @@ -104,10 +104,9 @@ var KeybindingEntry = GObject.registerClass({ if (event.type() != Clutter.EventType.KEY_PRESS) return Clutter.EVENT_PROPAGATE; - let str = Gtk.accelerator_name_with_keycode(null, - event.get_key_symbol(), - event.get_key_code(), - event.get_state()); + const str = Meta.accelerator_name( + event.get_state(), event.get_key_symbol()); + this.set_text(str); this.emit('keybinding-edited', str); return Clutter.EVENT_STOP;