diff options
author | lukefromdc <[email protected]> | 2016-10-08 15:01:44 -0400 |
---|---|---|
committer | lukefromdc <[email protected]> | 2016-10-08 15:01:44 -0400 |
commit | 9e5ea15d104720cfee752c193b77f8b03558c6b9 (patch) | |
tree | c20e965e974ccdecfe95f576681144442cc6225e /src/caja-window-manage-views.c | |
parent | 24bb72b321c044479728fd1d43c941afc0309f18 (diff) | |
download | caja-9e5ea15d104720cfee752c193b77f8b03558c6b9.tar.bz2 caja-9e5ea15d104720cfee752c193b77f8b03558c6b9.tar.xz |
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
Diffstat (limited to 'src/caja-window-manage-views.c')
-rw-r--r-- | src/caja-window-manage-views.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/caja-window-manage-views.c b/src/caja-window-manage-views.c index 7afad09a..2fa24e2a 100644 --- a/src/caja-window-manage-views.c +++ b/src/caja-window-manage-views.c @@ -33,7 +33,9 @@ #include "caja-location-bar.h" #include "caja-search-bar.h" #include "caja-pathbar.h" +#if ENABLE_LIBUNIQUE == (1) #include "caja-main.h" +#endif #include "caja-window-private.h" #include "caja-window-slot.h" #include "caja-navigation-window-slot.h" @@ -601,7 +603,9 @@ caja_window_slot_open_location_full (CajaWindowSlot *slot, } else if (target_navigation) { target_window = caja_application_create_navigation_window (window->application, +#if ENABLE_LIBUNIQUE == (1) NULL, +#endif gtk_window_get_screen (GTK_WINDOW (window))); } else { target_window = caja_application_get_spatial_window @@ -1195,7 +1199,9 @@ got_file_info_for_view_selection_callback (CajaFile *file, GFile *location; GMountOperation *mount_op; MountNotMountedData *data; - +#if ENABLE_LIBUNIQUE == (0) + CajaApplication *app; +#endif slot = callback_data; g_assert (CAJA_IS_WINDOW_SLOT (slot)); g_assert (slot->determine_view_file == file); @@ -1308,10 +1314,15 @@ got_file_info_for_view_selection_callback (CajaFile *file, * happens when a new window cannot display its initial URI. */ /* if this is the only window, we don't want to quit, so we redirect it to home */ +#if ENABLE_LIBUNIQUE == (0) + app = CAJA_APPLICATION (g_application_get_default ()); + + if (g_list_length (gtk_application_get_windows (GTK_APPLICATION (app))) == 1) { +#else if (caja_application_get_n_windows () <= 1) { g_assert (caja_application_get_n_windows () == 1); - +#endif /* the user could have typed in a home directory that doesn't exist, in which case going home would cause an infinite loop, so we better test for that */ |