mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
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
This commit is contained in:
@@ -701,15 +701,15 @@ key_pressed_cb (GtkEventControllerKey *controller, guint keyval,
|
|||||||
{
|
{
|
||||||
switch (keyval) {
|
switch (keyval) {
|
||||||
case GDK_KEY_Up:
|
case GDK_KEY_Up:
|
||||||
if (state == 0)
|
if ((state & GDK_MODIFIER_MASK) == 0)
|
||||||
gtk_widget_activate_action (self->video, "video.volume-up", NULL);
|
gtk_widget_activate_action (self->video, "video.volume-up", NULL);
|
||||||
break;
|
break;
|
||||||
case GDK_KEY_Down:
|
case GDK_KEY_Down:
|
||||||
if (state == 0)
|
if ((state & GDK_MODIFIER_MASK) == 0)
|
||||||
gtk_widget_activate_action (self->video, "video.volume-down", NULL);
|
gtk_widget_activate_action (self->video, "video.volume-down", NULL);
|
||||||
break;
|
break;
|
||||||
case GDK_KEY_Left:
|
case GDK_KEY_Left:
|
||||||
if (state == 0) {
|
if ((state & GDK_MODIFIER_MASK) == 0) {
|
||||||
_handle_seek_key_press (self, FALSE);
|
_handle_seek_key_press (self, FALSE);
|
||||||
} else if (!self->key_held && (state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) {
|
} else if (!self->key_held && (state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) {
|
||||||
_handle_chapter_key_press (self, FALSE);
|
_handle_chapter_key_press (self, FALSE);
|
||||||
@@ -718,11 +718,11 @@ key_pressed_cb (GtkEventControllerKey *controller, guint keyval,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GDK_KEY_j:
|
case GDK_KEY_j:
|
||||||
if (state == 0)
|
if ((state & GDK_MODIFIER_MASK) == 0)
|
||||||
_handle_seek_key_press (self, FALSE);
|
_handle_seek_key_press (self, FALSE);
|
||||||
break;
|
break;
|
||||||
case GDK_KEY_Right:
|
case GDK_KEY_Right:
|
||||||
if (state == 0) {
|
if ((state & GDK_MODIFIER_MASK) == 0) {
|
||||||
_handle_seek_key_press (self, TRUE);
|
_handle_seek_key_press (self, TRUE);
|
||||||
} else if (!self->key_held && (state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) {
|
} else if (!self->key_held && (state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) {
|
||||||
_handle_chapter_key_press (self, TRUE);
|
_handle_chapter_key_press (self, TRUE);
|
||||||
@@ -731,7 +731,7 @@ key_pressed_cb (GtkEventControllerKey *controller, guint keyval,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GDK_KEY_l:
|
case GDK_KEY_l:
|
||||||
if (state == 0)
|
if ((state & GDK_MODIFIER_MASK) == 0)
|
||||||
_handle_seek_key_press (self, TRUE);
|
_handle_seek_key_press (self, TRUE);
|
||||||
break;
|
break;
|
||||||
case GDK_KEY_space:
|
case GDK_KEY_space:
|
||||||
|
Reference in New Issue
Block a user