Commit 56ee92d0 authored by Jesse van den Kieboom's avatar Jesse van den Kieboom

Fix application termination for OS X

parent 548fc8a1
......@@ -361,6 +361,26 @@ on_osx_will_terminate (GtkOSXApplication *osxapp,
_gedit_app_quit (GEDIT_APP (app));
}
static gboolean
on_osx_block_termination (GtkOSXApplication *osxapp,
GeditAppOSX *app)
{
GtkUIManager *manager;
GtkAction *action;
GeditWindow *window;
window = gedit_app_get_active_window (GEDIT_APP (app));
// Synthesize quit-all
manager = gedit_window_get_ui_manager (window);
action = gtk_ui_manager_get_action (manager,
"/ui/MenuBar/FileMenu/FileQuitMenu");
_gedit_cmd_file_quit (action, window);
return TRUE;
}
static gboolean
on_osx_open_files (GtkOSXApplication *osxapp,
gchar const **paths,
......@@ -413,6 +433,11 @@ gedit_app_osx_init (GeditAppOSX *app)
G_CALLBACK (on_osx_will_terminate),
app);
g_signal_connect (osxapp,
"NSApplicationBlockTermination",
G_CALLBACK (on_osx_block_termination),
app);
g_signal_connect (osxapp,
"NSApplicationOpenFiles",
G_CALLBACK (on_osx_open_files),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment