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 618:3ade50e8603c
prev614:a2d239d4438a
next635:76c63aac3590
author nkeynes
date Wed Jan 30 02:39:57 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Embed gdk_display_warp_pointer for GTK 2.6 implementations that lack in
(mainly for OSX)
Perform real modifier mapping to get CTRL+ALT for screen ungrab rather than
assuming the keysyms.
file annotate diff log raw
1.1 --- a/src/gtkui/main_win.c Mon Jan 28 02:38:09 2008 +0000
1.2 +++ b/src/gtkui/main_win.c Wed Jan 30 02:39:57 2008 +0000
1.3 @@ -168,11 +168,10 @@
1.4 * Only check Ctrl/Shift/Alt for state - don't want to check numlock/capslock/
1.5 * mouse buttons/etc
1.6 */
1.7 - int state = event->state & (GDK_SHIFT_MASK|GDK_CONTROL_MASK|GDK_MOD1_MASK);
1.8 - if( (state == GDK_CONTROL_MASK &&
1.9 - (event->keyval == GDK_Alt_L || event->keyval == GDK_Alt_R)) ||
1.10 - (state == GDK_MOD1_MASK &&
1.11 - (event->keyval == GDK_Control_L || event->keyval == GDK_Control_R)) ) {
1.12 + int mod = gdk_keycode_to_modifier(gtk_widget_get_display(widget), event->hardware_keycode);
1.13 + int state = event->state & gtk_accelerator_get_default_mod_mask();
1.14 + if( (state == GDK_CONTROL_MASK && mod == GDK_MOD1_MASK) ||
1.15 + (state == GDK_MOD1_MASK && mod == GDK_CONTROL_MASK) ) {
1.16 video_window_ungrab_display(win);
1.17 // Consume the keypress, DC doesn't get it.
1.18 return TRUE;
1.19 @@ -190,13 +189,6 @@
1.20 return TRUE;
1.21 }
1.22
1.23 -static gboolean on_video_window_grab_broken( GtkWidget *widget, GdkEventGrabBroken *event,
1.24 - gpointer user_data )
1.25 -{
1.26 - main_window_t win = (main_window_t)user_data;
1.27 - fprintf( stderr, "Grab broken\n" );
1.28 -}
1.29 -
1.30 static gboolean on_video_window_focus_changed( GtkWidget *widget, GdkEventFocus *event,
1.31 gpointer user_data )
1.32 {
1.33 @@ -293,8 +285,6 @@
1.34 g_signal_connect( win->window, "window-state-event",
1.35 G_CALLBACK(on_main_window_state_changed), win );
1.36
1.37 - g_signal_connect( win->video, "grab-broken-event",
1.38 - G_CALLBACK(on_video_window_grab_broken), win );
1.39 g_signal_connect( win->video, "key-press-event",
1.40 G_CALLBACK(on_video_window_key_pressed), win );
1.41 g_signal_connect( win->video, "key-release-event",
.