Skip to content

Commit

Permalink
hotkey: Check for Wayland to prevent crash. Closes: #1388
Browse files Browse the repository at this point in the history
  • Loading branch information
radioactiveman committed May 31, 2024
1 parent 48057ef commit bd0596e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/hotkey/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ const char GlobalHotkeys::about[] =

PluginConfig * get_config() { return &plugin_cfg; }

static bool has_x11_display()
{
GdkDisplay * display = gdk_display_get_default();
return GDK_IS_X11_DISPLAY(display);
}

/*
* plugin activated
*/
Expand All @@ -96,6 +102,12 @@ bool GlobalHotkeys::init()
return false;
}

if (!has_x11_display())
{
AUDERR("Global Hotkeys plugin only supports X11.\n");
return false;
}

setup_filter();
load_config();
grab_keys();
Expand Down

0 comments on commit bd0596e

Please sign in to comment.