tomwij      14/04/03 14:05:41

  Added:               
                        
mate-file-manager-1.6.3-r1-fix-x-caja-desktop-multiple-windows-issue.patch
  Log:
  Revision bump. Backported x-caja-desktop issue solution to fix unnecessary 
multiple windows popping up. Fixes bug #506660, reported by Joakim Tjernlund; 
backport inspired by infirit.
  
  (Portage version: HEAD/cvs/Linux x86_64, signed Manifest commit with key 
6D34E57D)

Revision  Changes    Path
1.1                  
mate-base/mate-file-manager/files/mate-file-manager-1.6.3-r1-fix-x-caja-desktop-multiple-windows-issue.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-file-manager/files/mate-file-manager-1.6.3-r1-fix-x-caja-desktop-multiple-windows-issue.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-file-manager/files/mate-file-manager-1.6.3-r1-fix-x-caja-desktop-multiple-windows-issue.patch?rev=1.1&content-type=text/plain

Index: 
mate-file-manager-1.6.3-r1-fix-x-caja-desktop-multiple-windows-issue.patch
===================================================================
Adjusted to build against 1.6.3 by removing the is_navigation boolean.

>From 4f1e756e08e61840eb9a52de4debee30006ea31e Mon Sep 17 00:00:00 2001
From: Stefano Karapetsas <stef...@karapetsas.com>
Date: Tue, 18 Mar 2014 18:16:45 +0100
Subject: [PATCH] Possible solution for x-caja-desktop issue

---
 src/caja-application.c         | 14 +++++++++++---
 src/caja-window-manage-views.c | 18 +++++++++++++-----
 2 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/src/caja-application.c b/src/caja-application.c
index 3f4282c..47c86c8 100644
--- a/src/caja-application.c
+++ b/src/caja-application.c
@@ -961,6 +961,15 @@ static void     drive_listen_for_eject_button      (GDrive 
*drive,
     }
 }
 
+static gboolean
+desktop_changed_callback_connect (CajaApplication *application)
+{
+    g_signal_connect_swapped (caja_preferences, "changed::" 
CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR,
+                              G_CALLBACK(desktop_location_changed_callback),
+                              G_OBJECT (application));
+    return FALSE;
+}
+
 void
 caja_application_startup (CajaApplication *application,
                           gboolean kill_shell,
@@ -1029,9 +1038,8 @@ static void     drive_listen_for_eject_button      
(GDrive *drive,
 
         /* Monitor the preference to have the desktop */
         /* point to the Unix home folder */
-        g_signal_connect_swapped (caja_preferences, "changed::" 
CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR,
-                                  
G_CALLBACK(desktop_location_changed_callback),
-                                  G_OBJECT (application));
+        g_timeout_add_seconds (30, (GSourceFunc) 
desktop_changed_callback_connect, application);
+
         /* Create the other windows. */
         if (urls != NULL || !no_default_window)
         {
diff --git a/src/caja-window-manage-views.c b/src/caja-window-manage-views.c
index c7918e6..616e85b 100644
--- a/src/caja-window-manage-views.c
+++ b/src/caja-window-manage-views.c
@@ -49,6 +49,7 @@
 #include <eel/eel-gtk-macros.h>
 #include <eel/eel-stock-dialogs.h>
 #include <eel/eel-string.h>
+#include <eel/eel-vfs-extensions.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
 #include <glib/gi18n.h>
@@ -527,8 +528,9 @@ static void load_new_location                         
(CajaWindowSlot         *s
     char *old_uri, *new_uri;
     int new_slot_position;
     GList *l;
-    gboolean target_navigation = FALSE, target_same = FALSE;
-    gboolean is_desktop;
+    gboolean target_navigation = FALSE;
+    gboolean target_same = FALSE;
+    gboolean is_desktop = FALSE;
 
     window = slot->pane->window;
 
@@ -567,7 +570,12 @@ static void load_new_location                         
(CajaWindowSlot         *s
             * otherwise it's the same window.
             */
             if (is_desktop) {
-               target_navigation = TRUE;
+                new_uri = g_file_get_uri (location);
+                if (g_str_has_prefix (new_uri, EEL_DESKTOP_URI))
+                    target_same = TRUE;
+                else
+                    target_navigation = TRUE;
+                g_free (new_uri);
             } else {
                target_same = TRUE;
             }
@@ -676,7 +684,7 @@ static void load_new_location                         
(CajaWindowSlot         *s
         }
     }
 
-    if ((target_window == window && target_slot == slot &&
+    if (!(is_desktop && target_same) && (target_window == window && 
target_slot == slot &&
              old_location && g_file_equal (old_location, location))) {
 
         if (callback != NULL) {
@@ -688,7 +696,7 @@ static void load_new_location                         
(CajaWindowSlot         *s
     }
 
     begin_location_change (target_slot, location, old_location, new_selection,
-                           CAJA_LOCATION_CHANGE_STANDARD, 0, NULL, callback, 
user_data);
+                           (is_desktop && target_same) ? 
CAJA_LOCATION_CHANGE_RELOAD : CAJA_LOCATION_CHANGE_STANDARD, 0, NULL, callback, 
user_data);
 
     /* Additionally, load this in all slots that have no location, this means
        we load both panes in e.g. a newly opened dual pane window. */
-- 
1.9.1





Reply via email to