From 70a94c5b7a42adc0995bf774c44587a0778be0d0 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 3 Aug 2010 19:49:10 +0100 Subject: [PATCH] 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 Reviewed-by: Keith Packard Signed-off-by: Keith Packard --- miext/rootless/rootlessCommon.c | 3 +++ 1 file changed, 3 insertions(+) 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);