Skip to content

Commit

Permalink
input: look for 'GNOME' as substring of XDG_CURRENT_DESKTOP
Browse files Browse the repository at this point in the history
...instead of checking whether XDG_CURRENT_DESKTOP equals `GNOME` when installing hotkeys into the compositor under Wayland. This will support both `GNOME` and `ubuntu:GNOME` for instance, the latter is the setting on Ubuntu 22.

Closes #164
  • Loading branch information
godmar authored Aug 19, 2022
1 parent a8e5ce4 commit 2f9c6d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static void remove_hotkeys_from_compositor(GromitData *data) {
if (!data->hot_keycode && !data->undo_keycode)
return;

if (xdg_current_desktop && strcmp(xdg_current_desktop, "GNOME") == 0) {
if (xdg_current_desktop && strstr(xdg_current_desktop, "GNOME") != 0) {
/*
Get all custom key bindings and save back the ones that are not from us.
*/
Expand Down Expand Up @@ -120,7 +120,7 @@ static void add_hotkeys_to_compositor(GromitData *data) {
if (!data->hot_keycode && !data->undo_keycode)
return;

if (xdg_current_desktop && strcmp(xdg_current_desktop, "GNOME") == 0) {
if (xdg_current_desktop && strstr(xdg_current_desktop, "GNOME") != 0) {

if(data->debug)
g_print("DEBUG: Detected GNOME under Wayland, adding our hotkeys to compositor\n");
Expand Down

0 comments on commit 2f9c6d2

Please sign in to comment.