diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-06-05 01:06:28 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-06-05 01:06:47 +0200 |
commit | ace1cfe576c56451b497e682ac56eb3a0a133eb6 (patch) | |
tree | 2636eab5f3e02430314f9530e4d1307f2130bcb0 /src/main.cpp | |
parent | a9d2231b74e2ce17c8ea8966f735047da1c5242f (diff) |
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 0c98bcb..369eb93 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -169,6 +169,7 @@ static AppIndicator *app_indicator; static gsr_global_shortcuts global_shortcuts; static bool global_shortcuts_initialized = false; +static bool global_shortcuts_received = false; struct AudioInput { std::string name; @@ -1469,6 +1470,7 @@ static void replace_meta_with_super(std::string &str) { static void shortcut_changed_callback(gsr_shortcut shortcut, void *userdata) { (void)userdata; + global_shortcuts_received = true; std::string trigger = shortcut.trigger_description; replace_meta_with_super(trigger); for(int i = 0; i < num_hotkeys; ++i) { @@ -1518,7 +1520,7 @@ static void register_global_shortcuts_once() { // On KDE plasma the shortcut menu popup will show up everytime this is used, so we dont want to call it everytime. // On Hyprland the global shortcut desktop portal is broken on older versions and crashes the desktop portal. // On GNOME this needs to be called everytime to register the shortcuts. The shortcut popup menu will show the first time only. - if(wayland_compositor == WaylandCompositor::UNKNOWN && !registered) { + if(wayland_compositor == WaylandCompositor::UNKNOWN && !registered && !global_shortcuts_received) { registered = true; on_register_hotkeys_button_clicked(nullptr, nullptr); } |