Search
lxdream.org :: lxdream :: r612:410b48e63d53
lxdream 0.9.1
released Jun 29
Download Now
changeset612:410b48e63d53
parent611:0c5f53a87501
child613:c2dd87f947b2
authornkeynes
dateSat Jan 26 03:45:49 2008 +0000 (11 years ago)
Ignore Numlock, Capslock, etc when checking for grab exit
src/gtkui/main_win.c
1.1 --- a/src/gtkui/main_win.c Sat Jan 26 03:44:22 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.
.