From 064f1ff4d56da2d0fc6b9cce674c667c5d3c7ec4 Mon Sep 17 00:00:00 2001
From: hordepfo <hordepfo@gmail.com>
Date: Tue, 27 May 2014 21:53:17 +0100
Subject: Ignore adding a window if it's already present

If a window is added and it's already in the compositor's
window list, then it won't be added again. This was causing
strange behaviour in the compositor (windows and panels
disappearing).
---
 src/compositor/compositor-xrender.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 805002e3..6294e9d7 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -1821,6 +1821,10 @@ add_win (MetaScreen *screen,
 
   if (xwindow == info->output)
     return;
+    
+  /* If already added, ignore */
+  if (find_window_for_screen (screen, xwindow) != NULL)
+    return;
 
   cw = g_new0 (MetaCompWindow, 1);
   cw->screen = screen;
-- 
cgit v1.2.1