[Xfce4-commits] [xfce/xfdesktop] 01/01: Fix xfdesktop --reload in spanning mode (Bug 10853)

noreply at xfce.org noreply at xfce.org
Mon Aug 18 11:14:24 CEST 2014


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfdesktop.

commit c9820367b285e9e3f32805b5b43459e76450b38f
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Mon Aug 18 12:07:07 2014 +0300

    Fix xfdesktop --reload in spanning mode (Bug 10853)
    
    When issuing an xfdesktop --reload while in spanning wallpaper
    mode, all the monitors would update their backdrop which means
    the wallpaper of the last monitor would then be shown. This
    fixes the logic to continue to show the wallpaper for the first
    monitor as intended.
---
 src/xfce-desktop.c |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c
index a3131fc..8e77440 100644
--- a/src/xfce-desktop.c
+++ b/src/xfce-desktop.c
@@ -598,13 +598,30 @@ workspace_backdrop_changed_cb(XfceWorkspace *workspace,
                               gpointer user_data)
 {
     XfceDesktop *desktop = XFCE_DESKTOP(user_data);
+    gint current_workspace = 0, monitor = 0, i;
 
     TRACE("entering");
 
     g_return_if_fail(XFCE_IS_WORKSPACE(workspace) && XFCE_IS_BACKDROP(backdrop));
 
-    if(xfce_desktop_get_current_workspace(desktop) == xfce_workspace_get_workspace_num(workspace))
-        backdrop_changed_cb(backdrop, user_data);
+    current_workspace = xfce_desktop_get_current_workspace(desktop);
+
+    /* Find out which monitor the backdrop is on */
+    for(i = 0; i < xfce_desktop_get_n_monitors(desktop); i++) {
+        if(backdrop == xfce_workspace_get_backdrop(desktop->priv->workspaces[current_workspace], i)) {
+            monitor = i;
+            break;
+        }
+    }
+
+    if(xfce_desktop_get_current_workspace(desktop) == xfce_workspace_get_workspace_num(workspace)) {
+        /* Update the backdrop!
+         * In spanning mode, ignore updates to monitors other than the primary
+         */
+        if(!xfce_workspace_get_xinerama_stretch(workspace) || monitor == 0) {
+            backdrop_changed_cb(backdrop, user_data);
+        }
+    }
 }
 
 static void

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list