Search
lxdream.org :: lxdream/src/gtkui/main_win.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gtkui/main_win.c
changeset 612:410b48e63d53
prev608:4f588e52bce0
next614:a2d239d4438a
author nkeynes
date Sat Jan 26 03:45:49 2008 +0000 (13 years ago)
permissions -rw-r--r--
last change Ignore Numlock, Capslock, etc when checking for grab exit
file annotate diff log raw
1.1 --- a/src/gtkui/main_win.c Sat Jan 26 02:45:27 2008 +0000
1.2 +++ b/src/gtkui/main_win.c Sat Jan 26 03:45:49 2008 +0000
1.3 @@ -165,10 +165,13 @@
1.4 /* Check for ungrab key combo (ctrl-alt). Unfortunately GDK sends it as
1.5 * a singly-modified keypress rather than a double-modified 'null' press,
1.6 * so we have to do a little more work.
1.7 + * Only check Ctrl/Shift/Alt for state - don't want to check numlock/capslock/
1.8 + * mouse buttons/etc
1.9 */
1.10 - if( (event->state == GDK_CONTROL_MASK &&
1.11 + int state = event->state & (GDK_SHIFT_MASK|GDK_CONTROL_MASK|GDK_MOD1_MASK);
1.12 + if( (state == GDK_CONTROL_MASK &&
1.13 (event->keyval == GDK_Alt_L || event->keyval == GDK_Alt_R)) ||
1.14 - (event->state == GDK_MOD1_MASK &&
1.15 + (state == GDK_MOD1_MASK &&
1.16 (event->keyval == GDK_Control_L || event->keyval == GDK_Control_R)) ) {
1.17 video_window_ungrab_display(win);
1.18 // Consume the keypress, DC doesn't get it.
.