[Xfce4-commits] [xfce/xfwm4] 01/01: Fix reparenting with compositor

noreply at xfce.org noreply at xfce.org
Sun Dec 28 22:59:16 CET 2014


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

olivier pushed a commit to branch master
in repository xfce/xfwm4.

commit 15f717edd9c721d59ca91473fe34f6e32b47e357
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Sun Dec 28 22:54:56 2014 +0100

    Fix reparenting with compositor
    
    Bug: 10978
    
    When reparenting a window, the corresponding compositor
    window could end up being created twice, causing left overs
    on the screen.
    
    Check if a window is already present prior to create it to
    avoid duplicates.
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/compositor.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 59d72e9..e73623c 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -18,7 +18,7 @@
 
         xcompmgr - (c) 2003 Keith Packard
         metacity - (c) 2003, 2004 Red Hat, Inc.
-        xfwm4    - (c) 2005-2011 Olivier Fourdan
+        xfwm4    - (c) 2005-2014 Olivier Fourdan
 
 */
 
@@ -1525,7 +1525,7 @@ paint_all (ScreenInfo *screen_info, XserverRegion region)
     TRACE ("Copying data back to screen");
     if(screen_info->zoomed)
     {
-        /* Fixme: copy back whole screen if zoomed 
+        /* Fixme: copy back whole screen if zoomed
            It would be better to scale the clipping region if possible. */
         XFixesSetPictureClipRegion (dpy, screen_info->rootBuffer, 0, 0, None);
     }
@@ -1537,7 +1537,7 @@ paint_all (ScreenInfo *screen_info, XserverRegion region)
 #ifdef HAVE_LIBDRM
 #if TIMEOUT_REPAINT
     use_dri = dri_enabled (screen_info);
-    
+
     if (use_dri)
     {
         /* sync all previous rendering commands, tell xlib to render the pixmap
@@ -2095,8 +2095,14 @@ add_win (DisplayInfo *display_info, Window id, Client *c)
 
     TRACE ("entering add_win: 0x%lx", id);
 
-    new = g_new0 (CWindow, 1);
+    new = find_cwindow_in_display (display_info, id);
+    if (new)
+    {
+        TRACE ("Window 0x%lx already added", id);
+        return;
+    }
 
+    new = g_new0 (CWindow, 1);
     myDisplayGrabServer (display_info);
     if (!XGetWindowAttributes (display_info->dpy, id, &new->attr))
     {
@@ -2459,7 +2465,7 @@ zoom_timeout_cb (gpointer data)
     static int   x_old=-1, y_old=-1;
 
     screen_info = (ScreenInfo *) data;
-    
+
     if(!screen_info->zoomed)
     {
         screen_info->zoom_timeout_id = 0;

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


More information about the Xfce4-commits mailing list