diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-09-12 09:18:56 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-09-12 09:18:56 -0700 |
commit | 1ae4b80027a97e8fbe553b980dc17ea540000d88 (patch) | |
tree | baeff455c1161ebd295c0484344a409264f8d1e3 /macos.c | |
parent | 1afe36840ddbc2d139c1f7e2b3607aecc88d9890 (diff) | |
download | subsurface-1ae4b80027a97e8fbe553b980dc17ea540000d88.tar.gz |
Make sure Subsurface receives Quit / Command-Q callback on Mac
As usual, things work slightly different on Mac. Quartz delivers some (but not
all) accelerator notifications differently. Command-Q and Subsurface->Quit now
work on Mac as well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'macos.c')
-rw-r--r-- | macos.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -104,6 +104,12 @@ const char *subsurface_default_filename() } } +static void show_main_window(GtkWidget *w, gpointer data) +{ + gtk_widget_show(main_window); + gtk_window_present(GTK_WINDOW(main_window)); +} + void subsurface_ui_setup(GtkSettings *settings, GtkWidget *menubar, GtkWidget *vbox, GtkUIManager *ui_manager) { @@ -141,5 +147,8 @@ void subsurface_ui_setup(GtkSettings *settings, GtkWidget *menubar, gtk_osxapplication_insert_app_menu_item (osx_app, sep, 3); gtk_osxapplication_set_use_quartz_accelerators(osx_app, TRUE); + g_signal_connect(osx_app,"NSApplicationDidBecomeActive",G_CALLBACK(show_main_window),NULL); + g_signal_connect(osx_app,"NSApplicationWillTerminate",G_CALLBACK(quit),NULL); + gtk_osxapplication_ready(osx_app); } |