[sawfish] xinerama + xconfigurewindow fix



commit 7fd7adef4efb01f110e146e60e7e7e8caf16d1c1
Author: Christopher Roy Bratusek <chris nanolx org>
Date:   Sat Nov 14 15:23:41 2009 +0100

    xinerama + xconfigurewindow fix

 ChangeLog     |    7 +++++++
 man/news.texi |    7 +++++++
 src/display.c |   20 +++++++++++++++++---
 3 files changed, 31 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e6e3f94..b919e10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,13 @@
 	* man/news.texi
 	* OPTIONS: updated
 
+	* src/display.c: When a window sends request_code 12 (X_ConfigureWindow), don't auto-asumme
+	                 it to be unmapped, as this may let several windows disappear at once randomly
+			 not just the one that sent the request, this bug appears mostly in Xinerama
+			 setups, but is not limited to it. The change is not 100% failsafe at the moment
+			 but it reduces the failure-rate by 95% which is the reason why it is integrated
+			 while not beeing final. [Janek Kozicki]
+
 2009-11-14  Teika kazura <teika lavabit com>
 	* sawfish-client.jl: won't say "bye" at exit. The greeting "bye" annoys if you use emacs' sawfish-mode, so drop it.
 
diff --git a/man/news.texi b/man/news.texi
index bc47832..14d3f79 100644
--- a/man/news.texi
+++ b/man/news.texi
@@ -83,6 +83,13 @@ collection with @code{rep_PUSHGC} / @code{rep_POPGC}. It also prevents
 @code{add_window_hook} from being called with uninitialised argument.
 [Timo Korvola, Janek Kozicki]
 
+ item When a window sends request_code 12 (X_ConfigureWindow), don't auto-asumme
+it to be unmapped, as this may let several windows disappear at once randomly
+not just the one that sent the request, this bug appears mostly in Xinerama
+setups, but is not limited to it. The change is not 100% failsafe at the moment
+but it reduces the failure-rate by 95% which is the reason why it is integrated
+while not beeing final. [Janek Kozicki]
+
 @item Build and Installation:
 @itemize +
 @item Library check: Fix in @code{SMlib} and @code{libICE} check on x11r7 [Christopher Bratusek]
diff --git a/src/display.c b/src/display.c
index 28dea6f..bf7bcc7 100644
--- a/src/display.c
+++ b/src/display.c
@@ -82,9 +82,23 @@ error_handler (Display *dpy, XErrorEvent *ev)
 	if (w != NULL)
 	{
 	    DB(("error_handler (%s)\n", rep_STR(w->name)));
-	    
+
 	    if (!WINDOW_IS_GONE_P (w))
-		remove_window (w, TRUE, TRUE);
+           {
+               /* don't unmap a window that had send an X_ConfigureWindow request */
+               if(
+                   /*     ev->type == 0 what is the "type" ? but I've seen that type is always 0 */
+                   /*&&*/ ev->error_code==BadWindow /* the window is bad, because it is not configured yet */
+                     &&   ev->request_code==X_ConfigureWindow
+                     &&   ev->minor_code==0 /* X_ConfigureWindow is not in an Xlib extension, so it must be 0 */
+               )
+               {
+                   return 0;
+               } else
+               {
+                   remove_window (w, TRUE, TRUE);
+               }
+           }
 
 	    /* so we call emit_pending_destroys () at some point
 	    rep_mark_input_pending (ConnectionNumber (dpy)); */
@@ -442,7 +456,7 @@ void
 send_client_message (Window w, Atom a, Time time)
 {
   XClientMessageEvent ev;
-  
+
   ev.type = ClientMessage;
   ev.window = w;
   ev.message_type = xa_wm_protocols;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]