Search
lxdream.org :: lxdream :: r668:c62dff190859
lxdream 0.9.1
released Jun 29
Download Now
changeset668:c62dff190859
parent667:0e1ac8da75d9
child669:ab344e42bca9
authornkeynes
dateSun Apr 20 05:30:07 2008 +0000 (11 years ago)
Use the command key for osx exit, as it seems easier than ctrl-alt at the moment
src/gtkui/main_win.c
1.1 --- a/src/gtkui/main_win.c Sat Apr 19 02:39:37 2008 +0000
1.2 +++ b/src/gtkui/main_win.c Sun Apr 20 05:30:07 2008 +0000
1.3 @@ -160,6 +160,15 @@
1.4 {
1.5 main_window_t win = (main_window_t)user_data;
1.6 if( win->is_grabbed ) {
1.7 +#ifdef HAVE_GTK_OSX
1.8 + /* On OSX, use the command key rather than ctrl-alt. Mainly because GTK/OSX
1.9 + * doesn't seem to be able to get ctrl-alt reliably
1.10 + **/
1.11 + if( event->keyval == GDK_Meta_L || event->keyval == GDK_Meta_R ) {
1.12 + video_window_ungrab_display(win);
1.13 + return TRUE;
1.14 + }
1.15 +#else
1.16 /* Check for ungrab key combo (ctrl-alt). Unfortunately GDK sends it as
1.17 * a singly-modified keypress rather than a double-modified 'null' press,
1.18 * so we have to do a little more work.
1.19 @@ -174,6 +183,7 @@
1.20 // Consume the keypress, DC doesn't get it.
1.21 return TRUE;
1.22 }
1.23 +#endif
1.24 }
1.25 input_event_keydown( NULL, gtk_get_unmodified_keyval(event), 1 );
1.26 return TRUE;
1.27 @@ -298,7 +308,11 @@
1.28 gtk_statusbar_pop( GTK_STATUSBAR(win->statusbar), 1 );
1.29 if( win->is_grabbed ) {
1.30 char buf[128];
1.31 +#ifdef HAVE_GTK_OSX
1.32 + snprintf( buf, sizeof(buf), "%s %s", text, _("(Press <command> to release grab)") );
1.33 +#else
1.34 snprintf( buf, sizeof(buf), "%s %s", text, _("(Press <ctrl><alt> to release grab)") );
1.35 +#endif
1.36 gtk_statusbar_push( GTK_STATUSBAR(win->statusbar), 1, buf );
1.37 } else {
1.38 gtk_statusbar_push( GTK_STATUSBAR(win->statusbar), 1, text );
.