[Xquartz-dev] XRandR update

Jan Hauffa hauffa at in.tum.de
Sat Jul 17 09:00:46 PDT 2010


Hi,

I apologize for the lack of communication from my side. The problem of
enabling/disabling rootless mode when changing the screen resolution
turned out to be more complicated than expected, and only recently did I
find the time to investigate further.

I've attached an updated series of patches: Patches 1 and 3 are
unchanged from the previous submission. Patch 1 contains the basic
implementation of RandR mode setting, and patch 3 removes the FAKE_RANDR
code. Patch 2 makes RandR report a "fake mode" that corresponds to the
screen resolution at startup of the X server, but excluding the height
of the menu bar. If a client requests this screen mode, rootless mode is
enabled, for all other modes it is disabled.

The problem I was struggling with is that if the screen resolution was
changed while the root window was visible, the server would crash. When
the resolution is changed, he event handler in darwinEvents.c calls
QuartzUpdateScreens, which resizes the root window and fills it with the
background color. To resize the window, RootlessWindowResize is called,
which contains a special case for resizing the root window:
xprResizeFrame is not called for the root window, so the subsequent call
to xprStartDrawing will return a pointer to a buffer that is smaller
than expected.

I have implemented two methods of working around this problem: The first
patch (0002-<...>.patch) simply makes RootlessWindowResize call
xprResizeFrame. This is the most straightforward approach, but it adds
an "ifdef XQUARTZ" block to unrelated code.
The only alternative, as far as I can see, is to destroy the root window
before changing the screen resolution, and to ensure that a new root
window of correct size is created afterwards. As you can see in patch
"alt-0002-<...>.patch", this makes the logic in
QuartzRandRSetConfiguration rather complex.

Perhaps I'm just missing an obvious solution, as I've been staring at
this code for too long...

Regards,
   Jan

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-XQuartz-Implement-basic-RandR-functionality.patch
URL: <http://lists.macosforge.org/pipermail/xquartz-dev/attachments/20100717/2f025d1a/attachment-0004.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-XQuartz-Toggle-rootless-mode-on-XRandR-mode-switch.patch
URL: <http://lists.macosforge.org/pipermail/xquartz-dev/attachments/20100717/2f025d1a/attachment-0005.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0003-XQuartz-Remove-FAKE_RANDR-code.patch
URL: <http://lists.macosforge.org/pipermail/xquartz-dev/attachments/20100717/2f025d1a/attachment-0006.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: alt-0002-XQuartz-Toggle-rootless-mode-on-XRandR-mode-switch.patch
URL: <http://lists.macosforge.org/pipermail/xquartz-dev/attachments/20100717/2f025d1a/attachment-0007.ksh>


More information about the Xquartz-dev mailing list