~ubuntu-branches/ubuntu/vivid/xfdesktop4/vivid-proposed

« back to all changes in this revision

Viewing changes to debian/patches/xubuntu_set-accountsservice-user-bg.patch

  • Committer: Package Import Robot
  • Author(s): Sean Davis
  • Date: 2014-08-11 22:25:48 UTC
  • mfrom: (1.5.11)
  • Revision ID: package-import@ubuntu.com-20140811222548-osc1fppwc8k8r3ix
Tags: 4.11.7-0ubuntu1
* New upstream development release
* debian/patches/xubuntu_set-accountsservice-user-bg.patch: update
  patch to only update on first workspace filename change (LP: #1318307)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
 #ifdef ENABLE_DESKTOP_ICONS
19
19
 #include "xfdesktop-icon-view.h"
20
 
@@ -352,6 +353,88 @@ create_bg_pixmap(GdkScreen *gscreen, gpo
 
20
@@ -118,6 +119,8 @@
 
21
     GtkWidget *icon_view;
 
22
     gdouble system_font_size;
 
23
 #endif
 
24
+
 
25
+    gchar *last_filename;
 
26
 };
 
27
 
 
28
 enum
 
29
@@ -359,11 +362,94 @@
21
30
 }
22
31
 
23
32
 static void
106
115
 backdrop_changed_cb(XfceBackdrop *backdrop, gpointer user_data)
107
116
 {
108
117
     XfceDesktop *desktop = XFCE_DESKTOP(user_data);
109
 
@@ -387,6 +470,10 @@ backdrop_changed_cb(XfceBackdrop *backdr
 
118
     GdkPixmap *pmap = desktop->priv->bg_pixmap;
 
119
     GdkScreen *gscreen = desktop->priv->gscreen;
 
120
+    gchar *new_filename = NULL;
 
121
     GdkRectangle rect;
 
122
     GdkRegion *clip_region = NULL;
 
123
     gint i, monitor = -1, current_workspace;
 
124
@@ -394,6 +480,20 @@
110
125
     }
111
126
     if(monitor == -1)
112
127
         return;
113
128
+    /* notify Accountsservice of the new bg (only for monitor0) */
114
129
+    if(monitor == 0)
 
130
+    {
115
131
+        if (xfce_desktop_get_current_workspace(desktop) == 0)
116
 
+            set_accountsservice_user_bg(xfce_backdrop_get_image_filename(backdrop));
 
132
+        {
 
133
+            new_filename = g_strdup(xfce_backdrop_get_image_filename(backdrop));
 
134
+            if (g_strcmp0(desktop->priv->last_filename, new_filename) != 0)
 
135
+            {
 
136
+                desktop->priv->last_filename = g_strdup(new_filename);
 
137
+                set_accountsservice_user_bg(xfce_backdrop_get_image_filename(backdrop));
 
138
+            }
 
139
+            g_free(new_filename);
 
140
+        }
 
141
+    }
117
142
 
118
143
 #ifdef G_ENABLE_DEBUG
119
144
     monitor_name = gdk_screen_get_monitor_plug_name(gscreen, monitor);
 
145
@@ -1405,7 +1505,9 @@
 
146
     desktop->priv->property_prefix = g_strdup(property_prefix);
 
147
 
 
148
     xfce_desktop_connect_settings(desktop);
 
149
-    
 
150
+
 
151
+    desktop->priv->last_filename = g_strdup("");
 
152
+
 
153
     return GTK_WIDGET(desktop);
 
154
 }
 
155