application: Put shared code into a common function

This commit is contained in:
Benjamin Otte 2017-11-30 00:09:37 +01:00
parent fe7c283aea
commit 4cce109e16
3 changed files with 13 additions and 14 deletions

View File

@ -38,6 +38,7 @@
#include "gtkbuilder.h"
#include "gtkshortcutswindow.h"
#include "gtkintl.h"
#include "gtkprivate.h"
/* NB: please do not add backend-specific GDK headers here. This should
* be abstracted via GtkApplicationImpl.
@ -311,13 +312,7 @@ gtk_application_shutdown (GApplication *g_application)
gtk_action_muxer_remove (application->priv->muxer, "app");
/* Keep this section in sync with gtk_main() */
/* Try storing all clipboard data we have */
_gtk_clipboard_store_all ();
/* Synchronize the recent manager singleton */
_gtk_recent_manager_sync ();
gtk_main_sync ();
G_APPLICATION_CLASS (gtk_application_parent_class)->shutdown (g_application);
}

View File

@ -995,15 +995,17 @@ gtk_main (void)
gtk_main_loop_level--;
if (gtk_main_loop_level == 0)
{
/* Keep this section in sync with gtk_application_shutdown() */
gtk_main_sync ();
}
/* Try storing all clipboard data we have */
_gtk_clipboard_store_all ();
void
gtk_main_sync (void)
{
/* Try storing all clipboard data we have */
_gtk_clipboard_store_all ();
/* Synchronize the recent manager singleton */
_gtk_recent_manager_sync ();
}
/* Synchronize the recent manager singleton */
_gtk_recent_manager_sync ();
}
/**

View File

@ -63,6 +63,8 @@ gchar * _gtk_get_lc_ctype (void);
void _gtk_ensure_resources (void);
void gtk_main_sync (void);
gboolean _gtk_boolean_handled_accumulator (GSignalInvocationHint *ihint,
GValue *return_accu,
const GValue *handler_return,