← Back to team overview

compiz team mailing list archive

[Bug 866752] Re: Sometimes configure events are missed and windows move slow as a result

 

Proposed follow up fix pending verification:


=== modified file 'debian/patches/fix-864330.patch'
--- debian/patches/fix-864330.patch	2011-10-12 10:06:03 +0000
+++ debian/patches/fix-864330.patch	2011-10-17 07:10:33 +0000
@@ -1,8 +1,8 @@
 === modified file 'plugins/move/src/move.cpp'
 Index: compiz-0.9.6+bzr20110929/plugins/move/src/move.cpp
 ===================================================================
---- compiz-0.9.6+bzr20110929.orig/plugins/move/src/move.cpp	2011-10-12 17:00:11.359395413 +0800
-+++ compiz-0.9.6+bzr20110929/plugins/move/src/move.cpp	2011-10-12 17:00:22.599451570 +0800
+--- compiz-0.9.6+bzr20110929.orig/plugins/move/src/move.cpp	2011-10-17 15:09:58.353653059 +0800
++++ compiz-0.9.6+bzr20110929/plugins/move/src/move.cpp	2011-10-17 15:10:07.081696339 +0800
 @@ -525,7 +525,7 @@
  		Window xid = CompOption::getIntOptionNamed (options, "window", 0);
  		int    lock = CompOption::getIntOptionNamed (options, "active", 0);
@@ -14,8 +14,8 @@
  	}
 Index: compiz-0.9.6+bzr20110929/src/privatescreen.h
 ===================================================================
---- compiz-0.9.6+bzr20110929.orig/src/privatescreen.h	2011-10-12 17:00:11.319395193 +0800
-+++ compiz-0.9.6+bzr20110929/src/privatescreen.h	2011-10-12 17:00:22.599451570 +0800
+--- compiz-0.9.6+bzr20110929.orig/src/privatescreen.h	2011-10-17 15:09:58.369653137 +0800
++++ compiz-0.9.6+bzr20110929/src/privatescreen.h	2011-10-17 15:10:07.081696339 +0800
 @@ -111,6 +111,8 @@
      virtual ~PendingEvent ();
  
@@ -45,8 +45,8 @@
      bool removeIfMatching (const PendingEvent::Ptr &p, XEvent *);
 Index: compiz-0.9.6+bzr20110929/src/privatewindow.h
 ===================================================================
---- compiz-0.9.6+bzr20110929.orig/src/privatewindow.h	2011-10-12 17:00:11.243394758 +0800
-+++ compiz-0.9.6+bzr20110929/src/privatewindow.h	2011-10-12 17:00:22.599451570 +0800
+--- compiz-0.9.6+bzr20110929.orig/src/privatewindow.h	2011-10-17 15:09:58.385653215 +0800
++++ compiz-0.9.6+bzr20110929/src/privatewindow.h	2011-10-17 15:10:07.125696557 +0800
 @@ -211,7 +211,7 @@
  
  	void readIconHint ();
@@ -66,8 +66,8 @@
  	struct timeval lastConfigureRequest;
 


Index: compiz-0.9.6+bzr20110929/src/window.cpp
 ===================================================================
---- compiz-0.9.6+bzr20110929.orig/src/window.cpp	2011-10-12 17:00:11.283395067 +0800
-+++ compiz-0.9.6+bzr20110929/src/window.cpp	2011-10-12 17:02:55.120207454 +0800
+--- compiz-0.9.6+bzr20110929.orig/src/window.cpp	2011-10-17 15:09:58.357653075 +0800
++++ compiz-0.9.6+bzr20110929/src/window.cpp	2011-10-17 15:10:29.229806152 +0800
 @@ -868,13 +868,16 @@
  
  	    }
@@ -116,7 +116,25 @@
  
  	if (serverFrameGeometry.x () == xwc.x)
  	    valueMask &= ~(CWX);
-@@ -1012,7 +1015,6 @@
+@@ -1004,6 +1007,17 @@
+ 
+ 	    }
+ 
++	    compiz::X11::PendingEvent::Ptr pc =
++		    boost::shared_static_cast<compiz::X11::PendingEvent> (compiz::X11::PendingConfigureEvent::Ptr (
++									      new compiz::X11::PendingConfigureEvent (
++										  screen->dpy (), serverFrame, valueMask, &xwc)));
++
++	    pendingConfigures.add (pc);
++	    if (priv->mClearCheckTimeout.active ())
++		priv->mClearCheckTimeout.stop ();
++	    priv->mClearCheckTimeout.start (boost::bind (&PrivateWindow::checkClear, priv),
++					    2000, 2500);
++
+ 	    XSendEvent (screen->dpy (), screen->root (), false,
+ 			SubstructureNotifyMask, (XEvent *) &xev);
+ 
+@@ -1012,13 +1026,17 @@
  	}
  	else
  	{
@@ -124,7 +142,18 @@
  	    compiz::X11::PendingEvent::Ptr pc =
  		    boost::shared_static_cast<compiz::X11::PendingEvent> (compiz::X11::PendingConfigureEvent::Ptr (
  									      new compiz::X11::PendingConfigureEvent (
-@@ -2051,7 +2053,7 @@
+ 										  screen->dpy (), serverFrame, valueMask, &xwc)));
+ 
+ 	    pendingConfigures.add (pc);
++	    if (priv->mClearCheckTimeout.active ())
++		priv->mClearCheckTimeout.stop ();
++	    priv->mClearCheckTimeout.start (boost::bind (&PrivateWindow::checkClear, priv),
++					    2000, 2500);
++
+ 	    XConfigureWindow (screen->dpy (), serverFrame, valueMask, &xwc);
+ 	}
+ 

This ensures that configure event serials generated by frame updates in
the case of unity's undecoration are correctly added to the event queue
so that they will be cleared later on when compiz gets the event for
them.


+@@ -2051,7 +2069,7 @@
  #ifdef DEBUG
  	abort ();
  #else
@@ -133,7 +162,7 @@
  #endif
      }
  
-@@ -2160,28 +2162,13 @@
+@@ -2160,28 +2178,13 @@
  	{
  	    XWindowChanges xwc;
  	    unsigned int   valueMask = CWX | CWY;
@@ -163,7 +192,7 @@
  	}
      }
  }
-@@ -2192,16 +2179,59 @@
+@@ -2192,16 +2195,59 @@
      return !mEvents.empty ();
  }
  
@@ -224,7 +253,7 @@
  }
  
  bool
-@@ -2227,8 +2257,21 @@
+@@ -2227,8 +2273,21 @@
      return false;
  }
  
@@ -246,7 +275,7 @@
  }
  
  compiz::X11::PendingEventQueue::~PendingEventQueue ()
-@@ -2271,7 +2314,44 @@
+@@ -2271,7 +2330,44 @@
  bool
  compiz::X11::PendingConfigureEvent::matchVM (unsigned int valueMask)
  {
@@ -292,7 +321,7 @@
  }
  
  bool
-@@ -2283,29 +2363,16 @@
+@@ -2283,29 +2379,16 @@
      if (!compiz::X11::PendingEvent::match (event))
  	return false;
  
@@ -332,7 +361,7 @@
  
      /* Remove events from the queue
       * even if they didn't match what
-@@ -2399,7 +2466,6 @@
+@@ -2399,7 +2482,6 @@
  	    xwc.x = priv->serverFrameGeometry.x ();
  	    xwc.y = priv->serverFrameGeometry.y ();
  
@@ -340,7 +369,7 @@
  	    compiz::X11::PendingEvent::Ptr pc =
  		    boost::shared_static_cast<compiz::X11::PendingEvent> (compiz::X11::PendingConfigureEvent::Ptr (
  									      new compiz::X11::PendingConfigureEvent (
-@@ -2407,6 +2473,11 @@
+@@ -2407,6 +2489,11 @@
  
  	    priv->pendingConfigures.add (pc);
  
@@ -352,7 +381,7 @@
  	    XConfigureWindow (screen->dpy (), ROOTPARENT (this), valueMask, &xwc);
  
  	    if (priv->serverFrame)
-@@ -3218,11 +3289,18 @@
+@@ -3218,11 +3305,18 @@
      return pc->matchVM (CWStackMode | CWSibling);
  }
  
@@ -372,7 +401,7 @@
  
      /* Immediately sync window position
       * if plugins were updating w->geometry () directly
-@@ -3232,28 +3310,37 @@
+@@ -3232,28 +3326,37 @@
  
      /* Remove redundant bits */
  
@@ -406,19 +435,19 @@
 +	    bool matchingRequest = priv->pendingConfigures.forEachIf (boost::bind (isExistingRequest, _1, *xwc, valueMask));
 +	    bool restackPending = window->serverPrev->priv->pendingConfigures.forEachIf (boost::bind (isPendingRestack, _1));
 +	    bool remove = matchingRequest;
++
++	    if (!remove)
++		remove = !restackPending;
  
 -	if (window->serverPrev->priv->pendingConfigures.forEachIf (boost::bind (isPendingRestack, _1)))
 -	    valueMask &= ~(CWSibling | CWStackMode);
-+	    if (!remove)
-+		remove = !restackPending;
-+
 +	    if (remove)
 +		valueMask &= ~(CWSibling | CWStackMode);
 +	}
      }
  
      if (valueMask & CWBorderWidth)
-@@ -3289,13 +3376,18 @@
+@@ -3289,13 +3392,18 @@
  	    compLogMessage ("core", CompLogLevelWarn, "restack_mode not Above");
      }
  
@@ -440,7 +469,7 @@
  				      + serverInput.left + serverInput.right)
  	frameValueMask &= ~(CWWidth);
  
-@@ -3305,13 +3397,15 @@
+@@ -3305,13 +3413,15 @@
  
      if (shaded)
      {
@@ -458,7 +487,7 @@
  	    + serverInput.top + serverInput.bottom)
  	    frameValueMask &= ~(CWHeight);
      }
-@@ -3354,14 +3448,16 @@
+@@ -3354,14 +3464,16 @@
  	    wc.width  = serverFrameGeometry.width ();
  	    wc.height = serverFrameGeometry.height ();
  
@@ -477,7 +506,7 @@
  
  	    XConfigureWindow (screen->dpy (), serverFrame, frameValueMask, &wc);
  	}
-@@ -4053,13 +4149,16 @@
+@@ -4055,13 +4167,16 @@
  
  		if (serverFrame)
  		{
@@ -495,7 +524,7 @@
  		}
  
  		/* Below with no sibling puts the window at the bottom
-@@ -4072,8 +4171,15 @@
+@@ -4074,8 +4189,15 @@
  	    }
  	    else if (sibling)
  	    {
@@ -512,7 +541,7 @@
  		{
  		    mask |= CWSibling | CWStackMode;
  
-@@ -6150,8 +6256,6 @@
+@@ -6152,8 +6274,6 @@
      if (dbg)
  	dbg->overrideRedirectRestack (priv->id, aboveId);
  
@@ -521,7 +550,7 @@
      priv->attrib = wa;
      priv->serverGeometry.set (priv->attrib.x, priv->attrib.y,
  			      priv->attrib.width, priv->attrib.height,
-@@ -7085,9 +7189,15 @@
+@@ -7087,9 +7207,15 @@
      XUnmapWindow (screen->dpy (), serverFrame);
      XDestroyWindow (screen->dpy (), wrapper);

** Changed in: unity
    Milestone: 4.24.0 => 4.26.0

** Changed in: compiz (Ubuntu)
     Assignee: (unassigned) => Sam Spilsbury (smspillaz)

-- 
You received this bug notification because you are a member of compiz
packagers, which is subscribed to compiz in Ubuntu.
https://bugs.launchpad.net/bugs/866752

Title:
  Sometimes configure events are missed and windows move slow as a
  result

To manage notifications about this bug go to:
https://bugs.launchpad.net/compiz/+bug/866752/+subscriptions