diff options
-rw-r--r-- | dix/dispatch.c | 26 | ||||
-rw-r--r-- | dix/events.c | 11 | ||||
-rw-r--r-- | dix/window.c | 33 | ||||
-rw-r--r-- | include/windowstr.h | 15 |
4 files changed, 81 insertions, 4 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c index ae203f07c..d9d26538d 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.5.8.1 2004/12/09 18:59:51 deronj Exp $ */ +/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.5.6.2 2004/12/11 01:50:40 deronj Exp $ */ /* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ /************************************************************ @@ -1001,6 +1001,9 @@ ProcGetGeometry(client) return(client->noClientException); } +#ifdef LG3D +#include "../Xext/lgeint.h" +#endif /* LG3D */ int ProcQueryTree(client) @@ -1024,6 +1027,27 @@ ProcQueryTree(client) reply.parent = pWin->parent->drawable.id; else reply.parent = (Window)None; + +#ifdef LG3D + /* + ** HACK ALERT: + ** Bug fix for lg3d bug 213. The emacs Optional menu displays + ** tooltips for its entries. The emacs code (or possibly the + ** Xaw3d code which provides the tooltips) cannot handle it + ** when these tooltips are reparented to the PRW; emacs takes + ** a segv. As a short-term workaround we will lie to the client + ** and say that a window is still parented off the root window + ** if it is an override redirect window that has been reparented + ** to the PRW. + ** + ** TODO: someday: it would be nice to fix the client bug and + ** get rid of this hack. + */ + if (wovRedirLieAboutRootParent(pWin)) { + reply.parent = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; + } +#endif /* LG3D */ + pHead = RealChildHead(pWin); for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) numChildren++; diff --git a/dix/events.c b/dix/events.c index c549e8828..8ed4c4c01 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 1.6.4.1.4.1 2004/12/09 18:59:51 deronj Exp $ */ +/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 1.6.4.1.2.3 2004/12/11 01:50:40 deronj Exp $ */ /* $XFree86: xc/programs/Xserver/dix/events.c,v 3.51 2004/01/12 17:04:52 tsi Exp $ */ /************************************************************ @@ -1968,7 +1968,7 @@ lgeFixUpEventFromWindow( Window child, Bool calcChild) { - Window eventWindowOld; + Window eventWindowOld = INVALID; /* ErrorF("Enter FixUpEventFromWindow, event type = %d\n", xE->u.u.type); @@ -2054,8 +2054,12 @@ lgeFixUpEventFromWindow( caching might optimize this */ WindowPtr pOuterWin = (WindowPtr) LookupIDByType(eventWindowOld, RT_WINDOW); if (pOuterWin == NULL) { + /* + ** This can happen if the window has died since the pick on the window + ** occurred. So we don't need to be verbose about it. ErrorF("Error: FixupEventFromWindow: outer window %d, not found. No XY fix up occuring.\n", eventWindowOld); + */ } else { /* ** Make the event coords relative to the destination window @@ -5220,6 +5224,9 @@ WriteEventsToClient(pClient, count, events) ev->u.u.type, pClient->index, ev->u.keyButtonPointer.eventX, ev->u.keyButtonPointer.eventY, ev->u.keyButtonPointer.event); + if (ev->u.u.type == 4 || ev->u.u.type == 5) { + ErrorF("Button detail = %d\n", ev->u.u.detail); + } } } } diff --git a/dix/window.c b/dix/window.c index 57bef9573..cf9c674af 100644 --- a/dix/window.c +++ b/dix/window.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/dix/window.c,v 1.6.4.1.2.2 2004/12/15 18:23:07 deronj Exp $ */ +/* $XdotOrg: xc/programs/Xserver/dix/window.c,v 1.6.4.1.2.3 2004/12/16 20:23:36 deronj Exp $ */ /* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ /* @@ -2643,6 +2643,28 @@ ReparentWindow(pWin, pParent, x, y, client) event.u.reparent.override = pWin->overrideRedirect; DeliverEvents(pWin, &event, 1, pParent); +#ifdef LG3D + /* + ** HACK ALERT: + ** Bug fix for lg3d bug 213. If the window is override redirect, + ** and the old parent is the root window, and the new parent is + ** the PRW, have QueryTree lie about the parent and say that the + ** parent is still the root window. For more info refer to the + ** comment in ProcQueryTree. + ** + ** TODO: someday: it would be nice to fix the client bug and + ** get rid of this hack. + */ + if (pWin->overrideRedirect && + pWin->parent == WindowTable[pWin->drawable.pScreen->myNum] && + pParent == pLgeDisplayServerPRWWin) { + pWin->optional->ovRedirLieAboutRootParent = 1; + /*ErrorF("Lying about parent for window %d\n", pWin->drawable.id);*/ + } else { + pWin->optional->ovRedirLieAboutRootParent = 0; + } +#endif /* LG3D */ + /* take out of sibling chain */ pPriorParent = pPrev = pWin->parent; @@ -3755,6 +3777,14 @@ CheckWindowOptionalNeed (w) return; if (optional->colormap != parentOptional->colormap) return; +#ifdef LG3D + if (optional->ovRedirCompRedirClient != NULL) { + return; + } + if (optional->ovRedirLieAboutRootParent != 0) { + return; + } +#endif /* LG3D */ DisposeWindowOptional (w); } @@ -3805,6 +3835,7 @@ MakeWindowOptional (pWin) optional->colormap = parentOptional->colormap; #ifdef LG3D optional->ovRedirCompRedirClient = NULL; + optional->ovRedirLieAboutRootParent = 0; #endif /* LG3D */ pWin->optional = optional; return TRUE; diff --git a/include/windowstr.h b/include/windowstr.h index 5c160f80a..68f813991 100644 --- a/include/windowstr.h +++ b/include/windowstr.h @@ -96,6 +96,14 @@ typedef struct _WindowOpt { ** Only valid for override redirect windows. */ ClientPtr ovRedirCompRedirClient; + + /* + ** HACK ALERT: + ** Bug fix for lg3d bug 213. See comment in ProcQueryTree. + ** TODO: someday: it would be nice to fix the client bug and + ** get rid of this hack. + */ + unsigned ovRedirLieAboutRootParent : 1; #endif /* LG3D */ } WindowOptRec, *WindowOptPtr; @@ -187,6 +195,13 @@ extern Mask DontPropagateMasks[]; #ifdef LG3D #define wOvRedirCompRedirClient(w) wUseDefault(w, ovRedirCompRedirClient, NULL) +/* +** HACK ALERT: +** Bug fix for lg3d bug 213. See comment in ProcQueryTree. +** TODO: someday: it would be nice to fix the client bug and +** get rid of this hack. +*/ +#define wovRedirLieAboutRootParent(w) wUseDefault(w, ovRedirLieAboutRootParent, 0) #endif /* LG3D */ /* true when w needs a border drawn. */ |