1. Fix 213

2. Disabled FixUpEventFromWindow message; this is not an error
This commit is contained in:
Deron Johnson 2004-12-23 23:50:22 +00:00
parent 4ec423310e
commit b48f080a92
4 changed files with 81 additions and 4 deletions

View file

@ -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++;

View file

@ -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);
}
}
}
}

View file

@ -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;

View file

@ -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. */