[PATCH resend 3/3] CreateRootWindow: Set root windows' drawable.x/y to -pScreen->x/y.

Aaron Plattner aplattner at nvidia.com
Wed Sep 28 15:46:08 PDT 2011


On 09/26/2011 10:53 PM, Jamey Sharp wrote:
> A window's DrawableRec's x and y fields contain the offsets to be
> applied to protocol-visible window-relative coordinates in order to make
> those coordinates screen-relative instead. When Xinerama is active,
> coordinates relative to the root window need to be adjusted for each
> screen by the position of that screen in the logical root coordinate
> space, so (-pScreen->x) and (-pScreen->y) are the natural values for
> the root drawable's x and y offsets.
> 
> This eliminates special cases throughout the Xinerama layer that needed
> to adjust coordinates as specified by clients if they were used relative
> to a root window.
> 
> While this deletes Xinerama-layer code that modified request buffers
> (aside from XID rewrites), some GC ops implementations also modify the
> request buffer. (miPolyFill is an example.) Since Xinerama submits the
> same request buffer once for each screen, it needs to undo the changes
> made by these ops, even though it doesn't make its own modifications any
> more. So I've preserved all Xinerama code that unconditionally saved and
> restored parts of the request buffer. If the save/restore code was
> conditional on whether the drawable was a root window, then it was safe
> to delete.
> 
> Signed-off-by: Jamey Sharp<jamey at minilop.net>

This breaks rendering to the root window.  For example, run "xsetroot
-solid green"  Part of the rendering is clipped away on one of the
screens.  E.g., on my setup with a 1024x768 screen and a 1920x1080
screen to the right of it, only the leftmost 896 pixels of the right
screen are rendered because its root window extends from column -1024
to 895, while its borderClip goes from 0 to 1919:

(gdb) p screenInfo.screens[1]->root->drawable
$1 = {type = 0 '\000', class = 1 '\001', depth = 24 '\030', bitsPerPixel = 32 ' ', id = 555, x = -1024, y = 0, width = 1920, height = 1080, 
  pScreen = 0x1a44dd0, serialNumber = 3010}
(gdb) p 1920 - 1024
$2 = 896
(gdb) p screenInfo.screens[1]->root->borderClip
$3 = {extents = {x1 = 0, y1 = 0, x2 = 1920, y2 = 1080}, data = 0x0}

-- Aaron


More information about the xorg-devel mailing list