From a46846c24da23ad81f3bca29d840f0fb06827690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Wed, 17 Apr 2024 18:26:10 +0200 Subject: [PATCH] clapper-app: Use "GDK_MODIFIER_MASK" with key controller state We need to use "GDK_MODIFIER_MASK" to remove all private fields from key controller state mask, otherwise its not zero on Xorg. Fixes #416 --- src/bin/clapper-app/clapper-app-window.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bin/clapper-app/clapper-app-window.c b/src/bin/clapper-app/clapper-app-window.c index e19bb34f..475b6b6a 100644 --- a/src/bin/clapper-app/clapper-app-window.c +++ b/src/bin/clapper-app/clapper-app-window.c @@ -701,15 +701,15 @@ key_pressed_cb (GtkEventControllerKey *controller, guint keyval, { switch (keyval) { case GDK_KEY_Up: - if (state == 0) + if ((state & GDK_MODIFIER_MASK) == 0) gtk_widget_activate_action (self->video, "video.volume-up", NULL); break; case GDK_KEY_Down: - if (state == 0) + if ((state & GDK_MODIFIER_MASK) == 0) gtk_widget_activate_action (self->video, "video.volume-down", NULL); break; case GDK_KEY_Left: - if (state == 0) { + if ((state & GDK_MODIFIER_MASK) == 0) { _handle_seek_key_press (self, FALSE); } else if (!self->key_held && (state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) { _handle_chapter_key_press (self, FALSE); @@ -718,11 +718,11 @@ key_pressed_cb (GtkEventControllerKey *controller, guint keyval, } break; case GDK_KEY_j: - if (state == 0) + if ((state & GDK_MODIFIER_MASK) == 0) _handle_seek_key_press (self, FALSE); break; case GDK_KEY_Right: - if (state == 0) { + if ((state & GDK_MODIFIER_MASK) == 0) { _handle_seek_key_press (self, TRUE); } else if (!self->key_held && (state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) { _handle_chapter_key_press (self, TRUE); @@ -731,7 +731,7 @@ key_pressed_cb (GtkEventControllerKey *controller, guint keyval, } break; case GDK_KEY_l: - if (state == 0) + if ((state & GDK_MODIFIER_MASK) == 0) _handle_seek_key_press (self, TRUE); break; case GDK_KEY_space: