From 9e5ea15d104720cfee752c193b77f8b03558c6b9 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Sat, 8 Oct 2016 15:01:44 -0400 Subject: GTK3: port libunique ->GtkApplication as build time option Add --disable-libunique configuration option for GTK3 builds. This builds a port from libunique to GtkApplication. keep GTK2 builds unchanged Caja can now be build with GTK2 and libunique, GTK3 and libunique, or GTK3 without libunique using GtkApplication instead GtkApplication port Based on cherrypicked nautilus commits from https://github.com/GNOME/nautilus/commit/a8481ee4bd8d34e792d63598fa5efb47736f9de4 main: adapt to GtkApplication changes through https://github.com/GNOME/nautilus/commit/c3382e0415d51082545f277c380d37be160e8d2d application: move nautilus_application_new() to its own function GTK3/GtkApplication builds: add --force-desktop option This is useful for other DE's All: StartupNotify=false in .desktop files, as caja never connects to notification daemons and in GtkApplication builds this causes busy spinning curors --- src/caja-window.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/caja-window.c') diff --git a/src/caja-window.c b/src/caja-window.c index 6995fcd7..398ec91c 100644 --- a/src/caja-window.c +++ b/src/caja-window.c @@ -32,7 +32,9 @@ #include "caja-application.h" #include "caja-bookmarks-window.h" #include "caja-information-panel.h" +#if ENABLE_LIBUNIQUE == (1) #include "caja-main.h" +#endif #include "caja-window-manage-views.h" #include "caja-window-bookmarks.h" #include "caja-window-slot.h" @@ -236,16 +238,18 @@ caja_window_init (CajaWindow *window) /* Register to menu provider extension signal managing menu updates */ g_signal_connect_object (caja_signaller_get_current (), "popup_menu_changed", G_CALLBACK (caja_window_load_extension_menus), window, G_CONNECT_SWAPPED); - +#if ENABLE_LIBUNIQUE == (1) /* Keep the main event loop alive as long as the window exists */ #if GTK_CHECK_VERSION(3, 0, 0) /* FIXME: port to GtkApplication with GTK3 */ + /*This is DONE when built with --disable-libunique */ //gtk_quit_add_destroy (1, GTK_WIDGET (window)); caja_main_event_loop_register (GTK_WIDGET (window)); #else gtk_quit_add_destroy (1, GTK_OBJECT (window)); caja_main_event_loop_register (GTK_OBJECT (window)); #endif +#endif } /* Unconditionally synchronize the GtkUIManager of WINDOW. */ @@ -1903,12 +1907,20 @@ caja_forget_history (void) CajaWindowSlot *slot; CajaNavigationWindowSlot *navigation_slot; GList *window_node, *l, *walk; +#if ENABLE_LIBUNIQUE == (0) + CajaApplication *app; + app = CAJA_APPLICATION (g_application_get_default ()); +#endif /* Clear out each window's back & forward lists. Also, remove * each window's current location bookmark from history list * so it doesn't get clobbered. */ +#if ENABLE_LIBUNIQUE == (0) + for (window_node = gtk_application_get_windows (GTK_APPLICATION (app)); +#else for (window_node = caja_application_get_window_list (); +#endif window_node != NULL; window_node = window_node->next) { @@ -1951,7 +1963,11 @@ caja_forget_history (void) free_history_list (); /* Re-add each window's current location to history list. */ +#if ENABLE_LIBUNIQUE == (0) + for (window_node = gtk_application_get_windows (GTK_APPLICATION (app)); +#else for (window_node = caja_application_get_window_list (); +#endif window_node != NULL; window_node = window_node->next) { -- cgit v1.2.1