Merge lp://staging/~smspillaz/compiz-core/compiz-core.work_923683 into lp://staging/compiz-core/0.9.5
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel van Vugt | Needs Resubmitting | ||
Alan Griffiths | Needs Fixing | ||
Review via email:
|
This proposal has been superseded by a proposal from 2012-02-06.
Description of the change
A lot of the work that I've wanted to do in order to properly fix this, but in a far more condensed form. (bug 923683). Proposing early so that ~vanvugt will see it :)
Always use the asynchronous codepaths in core. This commit changes the following:
* CompWindow::move is now just a wrapper around CompWindow:
* CompWindow:
* moveNotify is only ever called pre-request to the server in the case of
managed windows (SubstructureRe
the right place) and post ConfigureNotify for override redirect windows
* resizeNotify is always called post ConfigureNotify regardless of whether
or not the window is managed or not
* composite and opengl now use the geometry last sent to the server in order
to compute display matrices and window positions as well as damage regions
* decor now also does the above
* const correctness in include/
* removed priv->width and priv->height , which was just redundant data used for
window shading and honestly, is a ticking time bomb for future maintainers.
* CompWindow:
* Removed the majority of PrivateWindow:
of redundant code which PrivateWindow:
there was to send synthetic ConfigureNotify events to ourselves to notify about windows
moving within frame windows that don't move themselves. Its safer to use reconfigureXWindow
in this case and probably more sane too. We should look into removing the other update* functions.
Caveats:
0) There are no tests yet
1) Window movement performance will regress with this branch. This is *probably* due to the fact that for every slight movement, we send a full ConfigureWindow request to the X Server and it has to post back to us a full ConfigureNotify, for pretty much every pixel the window moves. In the case that we're not doing compositing thats fine, but in every other case its *super* chatty and largely unnecessary. This can probably be optimized a lot, but that will require work to gather up requests that we want to send to the X server - combine them (eg, merging the stack of requests based on the change mask and using the latest values where appropriate). Thats a lot of work and probably not appropriate in this branch
2) The diff is a little big
3) No tests
4) Window shading is more than likely going to break again, mostly because I haven't tested it yet, but also because shading does some strange things and manipulated geometry values in strange ways
5) No tests
Testing plan?
I would imagine here that the PendingConfigur
We'll need to get CompRegion into a testable state though, which is probably easily done.
Unmerged revisions
- 3034. By Sam Spilsbury
-
Merge lp:compiz-core
- 3033. By Sam Spilsbury
-
!= 0 not necessary
- 3032. By Sam Spilsbury
-
Fix logic errors
- 3031. By Sam Spilsbury
-
Now that geometry and serverGeometry both return the same thing, the changes
in client code don't make any sense to keep - 3030. By Sam Spilsbury
-
Merge lp:compiz-core
- 3029. By Sam Spilsbury
-
Remove some unnecessary cahgnes in the wobbly plugin
- 3028. By Sam Spilsbury
-
Don't set height = 0 if the window still has a pixmap
- 3027. By Sam Spilsbury
-
Base decision to send notifications to plugins on absolute position
changes - 3026. By Sam Spilsbury
-
updateState is bitwise, so never clobber it
- 3025. By Sam Spilsbury
-
Merged lp:~vanvugt/compiz-core/compiz-core/fix-981703-properly
The diff is big and scary, but its not too complicated. I'll explain each separate part
1 === modified file 'include/ core/window. h' core/window. h 2012-01-20 15:20:44 +0000 core/window. h 2012-01-31 17:12:59 +0000 tes);
2 --- include/
3 +++ include/
4 @@ -398,9 +398,9 @@
5
6 bool hasUnmapReference ();
7
8 - bool resize (XWindowAttribu
9 + bool resize (const XWindowAttributes &);
10
11 - bool resize (Geometry);
12 + bool resize (const Geometry &);
13
14 bool resize (int x, int y, int width, int height,
15 int border = 0);
const correctness
31 int x1, x2, y1, y2; :Geometry geom = priv->window- >geometry (); >output (); :Geometry &geom = priv->window- >serverGeometry (); >output ();
32
33 - CompWindow:
34 - CompWindowExtents output = priv->window-
35 + const CompWindow:
36 + const CompWindowExtents &output = priv->window-
more const correctness
35 + const CompWindow: :Geometry &geom = priv->window- >serverGeometry (); >output ();
36 + const CompWindowExtents &output = priv->window-
Lots of this - in paint code we want to use serverFoo because it was the last thing sent to the server. And this is always guarunteed to come back to us.
166 - unsigned int width = window->size ().width ();
167 - unsigned int height = window->size ().height ();
168 + unsigned int width = window->geometry ().width ();
169 + unsigned int height = window->geometry ().height ();
CompWindow::size was just returning CompSize (priv->width, priv->height) which was just redundant data which should be removed. Replaced it with geometry () for clarity
299 + void move (int dx, int dy, bool sync); :Geometry &g);
300 + bool resize (int dx, int dy, int dwidth, int dheight, int dborder);
301 + bool resize (const CompWindow:
302 + bool resize (const XWindowAttributes &attrib);
303 +
Added PrivateWindow::move and PrivateWindow: :resize - to be called whenever a new position / size comes back from the server. (cut'n'paste code from CompWindow::move and CompWindow::resize
335 - Request, NULL); >syncPosition (); border () * 2; width () + serverInput.left + serverInput.right + bw; height () + serverInput.top + serverInput.bottom + bw; metry.x () == xwc.x) etry.setX (xwc.x); width (), serverGeometry. height ()); >sendConfigureN otify (); >windowNotify (CompWindowNoti fyFrameUpdate. ..
336 - gettimeofday (&lastConfigure
337 - /* Flush any changes made to serverFrameGeometry or serverGeometry to the server
338 - * since there is a race condition where geometries will go out-of-sync with
339 - * window movement */
340 -
341 - window-
342 -
343 - if (serverInput.left || serverInput.right || serverInput.top || serverInput.bottom)
344 - {
345 - int bw = serverGeometry.
346 -
347 - xwc.x = serverGeometry.x () - serverInput.left;
348 - xwc.y = serverGeometry.y () - serverInput.top;
349 - xwc.width = serverGeometry.
350 - if (shaded)
351 - xwc.height = serverInput.top + serverInput.bottom + bw;
352 - else
353 - xwc.height = serverGeometry.
354 -
355 - if (shaded)
356 - height = serverInput.top + serverInput.bottom;
357 -
358 - if (serverFrameGeo
359 - valueMask &= ~(CWX);
360 - else
361 - serverFrameGeom
362 -
*snip*
616 - XMoveResizeWindow (screen->dpy (), id, 0, 0,
617 - serverGeometry.
618 - window-
619 - window-