diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2010-08-03 19:49:10 +0100 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-08-10 09:13:30 -0700 |
commit | 70a94c5b7a42adc0995bf774c44587a0778be0d0 (patch) | |
tree | 79884a9e776c9ffc4acee27e7586aa4bc30a9c74 /miext | |
parent | 3ab6cd31cbdf8095b2948034fce5fb645422d8da (diff) |
rootless: fix uninitialized private key assert in non-rootless modes in Cygwin/X
IsFramedWindow() is called from miPaintWindow() if the server has
been built with ROOTLESS defined, irrespective of if RootlessInit()
has ever been called, or not.
Add a check to IsFramedWindow() to check if rootlessWindowPrivateKey
has been registered (as a proxy for checking if the rootless extension
has been initialized) so we don't go on to try to use that key,
triggering an assert.
This bug exposes what appears to be a difference in opinion about
the rootless extension between XQuartz and XWin. XQuartz always
initializes the rootless extension, whereas XWin offers several modes
of operation, and the rootless extension is only used for one of them
That probably means that the all code under compile time guard for
ROOTLESS should be carefully checked that it doesn't also need to be
under a run-time guard
(I've reviewed the other ROOTLESS blocks in dix/events.c and
dix/window.c and they look ok -- keithp)
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'miext')
-rw-r--r-- | miext/rootless/rootlessCommon.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c index 82fe0b936..f91cfb432 100644 --- a/miext/rootless/rootlessCommon.c +++ b/miext/rootless/rootlessCommon.c @@ -92,6 +92,9 @@ IsFramedWindow(WindowPtr pWin) { WindowPtr top; + if (!dixPrivateKeyRegistered(&rootlessWindowPrivateKeyRec)) + return FALSE; + if (!pWin->realized) return FALSE; top = TopLevelParent(pWin); |