[mate-file-manager/f20] add new upstream patches

Wolfgang Ulbrich raveit65 at fedoraproject.org
Tue Apr 1 16:12:21 UTC 2014


commit e6004ea5781287cf359951184677a8a263ecd0f5
Author: raveit65 <chat-to-me at raveit.de>
Date:   Tue Apr 1 18:12:23 2014 +0200

    add new upstream patches

 mate-file-manager_remove-ck-usage.patch    |  205 ++++++++++++++++++++++++++++
 mate-file-manager_x-caja-windows-fix.patch |   90 ++++++++++++
 2 files changed, 295 insertions(+), 0 deletions(-)
---
diff --git a/mate-file-manager_remove-ck-usage.patch b/mate-file-manager_remove-ck-usage.patch
new file mode 100644
index 0000000..f27b4e2
--- /dev/null
+++ b/mate-file-manager_remove-ck-usage.patch
@@ -0,0 +1,205 @@
+diff --git a/src/caja-application.c b/src/caja-application.c
+index 47c86c8..0d0624a 100644
+--- a/src/caja-application.c
++++ b/src/caja-application.c
+@@ -368,12 +368,6 @@ static void     drive_listen_for_eject_button      (GDrive *drive,
+         application->automount_idle_id = 0;
+     }
+ 
+-    if (application->proxy != NULL)
+-    {
+-        g_object_unref (application->proxy);
+-        application->proxy = NULL;
+-    }
+-
+     if (fdb_manager != NULL)
+     {
+         g_object_unref (fdb_manager);
+@@ -559,151 +553,6 @@ static void     drive_listen_for_eject_button      (GDrive *drive,
+     g_free (do_once_file);
+ }
+ 
+-#define CK_NAME       "org.freedesktop.ConsoleKit"
+-#define CK_PATH       "/org/freedesktop/ConsoleKit"
+-#define CK_INTERFACE  "org.freedesktop.ConsoleKit"
+-
+-static void
+-ck_session_proxy_signal_cb (GDBusProxy *proxy,
+-                            const char *sender_name,
+-                            const char *signal_name,
+-                            GVariant   *parameters,
+-                            gpointer    user_data)
+-{
+-    CajaApplication *application = user_data;
+-
+-    if (g_strcmp0 (signal_name, "ActiveChanged") == 0)
+-    {
+-        g_variant_get (parameters, "(b)", &application->session_is_active);
+-    }
+-}
+-
+-static void
+-ck_call_is_active_cb (GDBusProxy   *proxy,
+-                      GAsyncResult *result,
+-                      gpointer      user_data)
+-{
+-    CajaApplication *application = user_data;
+-    GVariant *variant;
+-    GError *error = NULL;
+-
+-    variant = g_dbus_proxy_call_finish (proxy, result, &error);
+-
+-    if (variant == NULL)
+-    {
+-        g_warning ("Error when calling IsActive(): %s\n", error->message);
+-        application->session_is_active = TRUE;
+-
+-        g_error_free (error);
+-        return;
+-    }
+-
+-    g_variant_get (variant, "(b)", &application->session_is_active);
+-
+-    g_variant_unref (variant);
+-}
+-
+-static void
+-session_proxy_appeared (GObject       *source,
+-                        GAsyncResult *res,
+-                        gpointer      user_data)
+-{
+-    CajaApplication *application = user_data;
+-    GDBusProxy *proxy;
+-    GError *error = NULL;
+-
+-    proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+-
+-    if (error != NULL)
+-    {
+-        g_warning ("Failed to get the current CK session: %s", error->message);
+-        g_error_free (error);
+-
+-        application->session_is_active = TRUE;
+-        return;
+-    }
+-
+-    g_signal_connect (proxy, "g-signal",
+-                      G_CALLBACK (ck_session_proxy_signal_cb),
+-                      application);
+-
+-    g_dbus_proxy_call (proxy,
+-                       "IsActive",
+-                       g_variant_new ("()"),
+-                       G_DBUS_CALL_FLAGS_NONE,
+-                       -1,
+-                       NULL,
+-                       (GAsyncReadyCallback) ck_call_is_active_cb,
+-                       application);
+-
+-    application->proxy = proxy;
+-}
+-
+-static void
+-ck_get_current_session_cb (GDBusConnection *connection,
+-                           GAsyncResult    *result,
+-                           gpointer         user_data)
+-{
+-    CajaApplication *application = user_data;
+-    GVariant *variant;
+-    const char *session_path = NULL;
+-    GError *error = NULL;
+-
+-    variant = g_dbus_connection_call_finish (connection, result, &error);
+-
+-    if (variant == NULL)
+-    {
+-        g_warning ("Failed to get the current CK session: %s", error->message);
+-        g_error_free (error);
+-
+-        application->session_is_active = TRUE;
+-        return;
+-    }
+-
+-    g_variant_get (variant, "(&o)", &session_path);
+-
+-    g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
+-                              G_DBUS_PROXY_FLAGS_NONE,
+-                              NULL,
+-                              CK_NAME,
+-                              session_path,
+-                              CK_INTERFACE ".Session",
+-                              NULL,
+-                              session_proxy_appeared,
+-                              application);
+-
+-    g_variant_unref (variant);
+-}
+-
+-static void
+-do_initialize_consolekit (CajaApplication *application)
+-{
+-    GDBusConnection *connection;
+-
+-    connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
+-
+-    if (connection == NULL)
+-    {
+-        application->session_is_active = TRUE;
+-        return;
+-    }
+-
+-    g_dbus_connection_call (connection,
+-                            CK_NAME,
+-                            CK_PATH "/Manager",
+-                            CK_INTERFACE ".Manager",
+-                            "GetCurrentSession",
+-                            g_variant_new ("()"),
+-                            G_VARIANT_TYPE ("(o)"),
+-                            G_DBUS_CALL_FLAGS_NONE,
+-                            -1,
+-                            NULL,
+-                            (GAsyncReadyCallback) ck_get_current_session_cb,
+-                            application);
+-
+-    g_object_unref (connection);
+-}
+-
+ static void
+ do_upgrades_once (CajaApplication *application,
+                   gboolean no_desktop)
+@@ -752,9 +601,6 @@ static void     drive_listen_for_eject_button      (GDrive *drive,
+     /* Initialize the desktop link monitor singleton */
+     caja_desktop_link_monitor_get ();
+ 
+-    /* Initialize the ConsoleKit listener for active session */
+-    do_initialize_consolekit (application);
+-
+     /* Watch for mounts so we can restore open windows This used
+      * to be for showing new window on mount, but is not used
+      * anymore */
+@@ -1744,11 +1590,6 @@ static void     drive_listen_for_eject_button      (GDrive *drive,
+     CajaDirectory *directory;
+     GFile *root;
+ 
+-    if (!application->session_is_active)
+-    {
+-        return;
+-    }
+-
+     root = g_mount_get_root (mount);
+     directory = caja_directory_get_existing (root);
+     g_object_unref (root);
+diff --git a/src/caja-application.h b/src/caja-application.h
+index 0ad62f0..27cd8e1 100644
+--- a/src/caja-application.h
++++ b/src/caja-application.h
+@@ -66,8 +66,6 @@
+     EggSMClient* smclient;
+     GVolumeMonitor* volume_monitor;
+     unsigned int automount_idle_id;
+-    GDBusProxy* proxy;
+-    gboolean session_is_active;
+ } CajaApplication;
+ 
+ typedef struct
+
diff --git a/mate-file-manager_x-caja-windows-fix.patch b/mate-file-manager_x-caja-windows-fix.patch
new file mode 100644
index 0000000..a18de0f
--- /dev/null
+++ b/mate-file-manager_x-caja-windows-fix.patch
@@ -0,0 +1,90 @@
+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,10 @@ 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, is_navigation;
++    gboolean target_navigation = FALSE;
++    gboolean target_same = FALSE;
++    gboolean is_desktop = FALSE;
++    gboolean is_navigation = 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. */
+


More information about the scm-commits mailing list