# HG changeset patch # User nkeynes # Date 1208669407 0 # Node ID c62dff190859b9aee9a52f9c3e5ce57a492ba0c9 # Parent 0e1ac8da75d9e2a97dd9dc7c8cf051d2b4139681 Use the command key for osx exit, as it seems easier than ctrl-alt at the moment --- a/src/gtkui/main_win.c Sat Apr 19 02:39:37 2008 +0000 +++ b/src/gtkui/main_win.c Sun Apr 20 05:30:07 2008 +0000 @@ -160,6 +160,15 @@ { main_window_t win = (main_window_t)user_data; if( win->is_grabbed ) { +#ifdef HAVE_GTK_OSX + /* On OSX, use the command key rather than ctrl-alt. Mainly because GTK/OSX + * doesn't seem to be able to get ctrl-alt reliably + **/ + if( event->keyval == GDK_Meta_L || event->keyval == GDK_Meta_R ) { + video_window_ungrab_display(win); + return TRUE; + } +#else /* Check for ungrab key combo (ctrl-alt). Unfortunately GDK sends it as * a singly-modified keypress rather than a double-modified 'null' press, * so we have to do a little more work. @@ -174,6 +183,7 @@ // Consume the keypress, DC doesn't get it. return TRUE; } +#endif } input_event_keydown( NULL, gtk_get_unmodified_keyval(event), 1 ); return TRUE; @@ -298,7 +308,11 @@ gtk_statusbar_pop( GTK_STATUSBAR(win->statusbar), 1 ); if( win->is_grabbed ) { char buf[128]; +#ifdef HAVE_GTK_OSX + snprintf( buf, sizeof(buf), "%s %s", text, _("(Press to release grab)") ); +#else snprintf( buf, sizeof(buf), "%s %s", text, _("(Press to release grab)") ); +#endif gtk_statusbar_push( GTK_STATUSBAR(win->statusbar), 1, buf ); } else { gtk_statusbar_push( GTK_STATUSBAR(win->statusbar), 1, text );