I am in the process of basing Project Looking Glass on the Xorg 6.8 server. I would like to integrate this code into Xorg 6.8. All of my code is enclosed in #ifdef LG3D (which you can verify by reviewing the diffs below). By default this symbol is undefined. Therefore, this change is very low risk. The integrate of this code will greatly assist me in producing future products which are based on the X org server. Index: ChangeLog =================================================================== RCS file: /cvs/xorg/xc/ChangeLog,v retrieving revision 1.246 diff -r1.246 ChangeLog 0a1,85 > 2004-08-12 Deron Johnson <deron.johnson@sun.com> > > * include/extensions/Imakefile > * include/extensions/lge.h > Add client header file for the Project Looking Glass Extension (LGE). > > * lib/Xext/Imakefile > * lib/Xext/Xlge.c > Add extension request API for Project Looking Glass Extension (LGE). > > * config/cf/X11.tmpl > Add the build switch BuildLg3d which indicates whether Project Looking > Glass code (#ifdef LG3D) is to be compiled into the X server. This currently > defaults to NO (i.e. do not compile LG3D code) into the X server > > * programs/Xserver/composite/compalloc.c > Add code to zero out contents of the backing pixmap. > > * programs/Xserver/composite/compwindow.c > Fix bug in compCheckRedir. Note: this is not LG3D-specific code. > It is a bug fix recommended by keithp. > > * programs/Xserver/composite/cw.c > * programs/Xserver/composite/cw.h > Fix FUNC_EPILOGUE. > Use LG3D-specific MoveWindow and ResizeWindow. > > * programs/Xserver/composite/cw_ops.c > Fix bug in EPILOGUE macro. Note: this is not LG3D-specific code. > It is a bug fix recommended by keithp. > > * programs/Xserver/composite/Imakefile > * programs/Xserver/composite/lg3dwindow.c > Use LG3D-specific MoveWindow and ResizeWindow. These avoid calling > into the DDX during window movement and resizing. This prevents > Display ID plane group paintin from occuring, which prevents > nasty holes in the 3D environment. > > * programs/Xserver/dix/Imakefile > Added request dispatching debug code. > > * programs/Xserver/dix/events.c > Add code to specially handle the event stream when running in > LG3D mode. > > * programs/Xserver/dix/window.c > Add code to null out the cursor image when running in LG3D mode. > Redirect various window operations on override redirect windows to > the window manager. > > * programs/Xserver/dix/ds.c > * programs/Xserver/dix/ds.h > * programs/Xserver/dix/socketpicker.c > New files which provide routines to route device events to the > LG3D display server and back again. > > * programs/Xserver/dix/xytosubwin.c > A new file which provides a routine which, given the top-level > window in which the pointer lies, determines the lowest descendent > in which the pointer lies. > > * programs/Xserver/hw/xfree86/common/xf86Xinput.c > Routes device events to the LG3D display server and back again. > > * programs/Xserver/mi/miinitext.c > Configures the Project Looking Glass Extension (LGE). > > * programs/Xserver/mi/mivaltree.c > Prevents the ClipList and BorderClip shapes of the parent of > a redirected window from being updated. This is necessary to > avoid exposures on the pseudo-root window created by the > Display Server, which can lead to nasty "holes" in the > Display ID plane group of the device. > > * programs/Xserver/miext/damage/damage.c > Implements a hack to prevent PaintWindow from calling into the > DDX. This avoids nasty "holes" in the Display ID plane group of > the device. > > * programs/Xserver/Xext/Imakefile > * programs/Xserver/Xext/lge.c > * programs/Xserver/Xext/lgeint.h > Provides the request handlers for the Project Looking Glass > Extension (LGE). Index: config/cf/X11.tmpl =================================================================== RCS file: /cvs/xorg/xc/config/cf/X11.tmpl,v retrieving revision 1.24 diff -r1.24 X11.tmpl 675a676,679 > #ifndef BuildLg3d > #define BuildLg3d NO > #endif > 1232a1237,1244 > #ifndef Lg3dDefines > #if BuildLg3d > #define Lg3dDefines -DLG3D > #else > #define Lg3dDefines /**/ > #endif > #endif > 1243c1255 < XfixesDefines XDamageDefines CompositeDefines XevieDefines --- > XfixesDefines XDamageDefines CompositeDefines XevieDefines Lg3dDefines Index: include/extensions/Imakefile =================================================================== RCS file: /cvs/xorg/xc/include/extensions/Imakefile,v retrieving revision 1.10 diff -r1.10 Imakefile 69a70,72 > #if BuildLg3d > LG3DHEADERS = lge.h > #endif 76c79 < $(XEVIEHEADERS) \ --- > $(XEVIEHEADERS) $(LG3DHEADERS) \ 101c104,105 < XEVI.h XEVIstr.h --- > XEVI.h XEVIstr.h \ > lge.h Index: lib/Xext/Imakefile =================================================================== RCS file: /cvs/xorg/xc/lib/Xext/Imakefile,v retrieving revision 1.4 diff -r1.4 Imakefile 40c40,41 < XSecurity.c XAppgroup.c Xcup.c DPMS.c XEVI.c $(XEVIESRCS) --- > XSecurity.c XAppgroup.c Xcup.c DPMS.c XEVI.c $(XEVIESRCS) \ > Xlge.c 43c44,46 < XSecurity.o XAppgroup.o Xcup.o DPMS.o XEVI.o $(XEVIEOBJS) --- > XSecurity.o XAppgroup.o Xcup.o DPMS.o XEVI.o $(XEVIEOBJS) \ > Xlge.o > Index: programs/Xserver/Xext/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xext/Imakefile,v retrieving revision 1.6 diff -r1.6 Imakefile 114a115,119 > #if BuildLg3d > LG3DSRCS = lge.c > LG3DOBJS = lge.o > #endif > 120c125 < $(XEVIESRCS) \ --- > $(XEVIESRCS) $(LG3DSRCS) \ 128c133 < $(XEVIEOBJS) \ --- > $(XEVIEOBJS) $(LG3DOBJS) \ 133c138 < $(XEVIEOBJS) \ --- > $(XEVIEOBJS) $(LG3DOBJS) \ Index: programs/Xserver/composite/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/composite/Imakefile,v retrieving revision 1.2 diff -r1.2 Imakefile 4c4 < cw.c cw_ops.c cw_render.c --- > cw.c cw_ops.c cw_render.c lg3dwindow.c 7c7 < cw.o cw_ops.o cw_render.o --- > cw.o cw_ops.o cw_render.o lg3dwindow.o Index: programs/Xserver/composite/compalloc.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/composite/compalloc.c,v retrieving revision 1.2 diff -r1.2 compalloc.c 3a4,25 > * Copyright (c) 2004, Sun Microsystems, Inc. > * > * Permission to use, copy, modify, distribute, and sell this software and its > * documentation for any purpose is hereby granted without fee, provided that > * the above copyright notice appear in all copies and that both that > * copyright notice and this permission notice appear in supporting > * documentation. > * > * The above copyright notice and this permission notice shall be included in > * all copies or substantial portions of the Software. > * > * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > * OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN > * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN > * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. > * > * Except as contained in this notice, the name of The Open Group shall not be > * used in advertising or otherwise to promote the sale, use or other dealings > * in this Software without prior written authorization from The Open Group. > * 448a471,498 > > #ifdef LG3D > /* > ** Applications which use shaped windows (e.g. xeyes) don't > ** always clear the entire backing pixmap. We should clear the > ** backing pixmap here to avoid garbage from appearing. > */ > { > GCPtr pScratchGC = GetScratchGC(pPixmap->drawable.depth, pPixmap->drawable.pScreen); > ChangeGCVal v[2]; > xRectangle rect; > > v[0].val = GXcopy; > v[1].val = 0; > DoChangeGC(pScratchGC, (GCFunction|GCForeground), (XID*)v, 2); > ValidateGC((DrawablePtr)pPixmap, pScratchGC); > > rect.x = 0; > rect.y = 0; > rect.width = pPixmap->drawable.width; > rect.height = pPixmap->drawable.height; > > (*pScratchGC->ops->PolyFillRect)((DrawablePtr)pPixmap, pScratchGC, 1, &rect); > > FreeScratchGC(pScratchGC); > } > #endif /* LG3D */ > Index: compwindow.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/composite/compwindow.c,v retrieving revision 1.2 diff -r1.2 compwindow.c 106c106 < Bool should = pWin->viewable && (cw != NULL); --- > Bool should = pWin->realized && (cw != NULL); Index: programs/Xserver/composite/cw.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/composite/cw.c,v retrieving revision 1.7 diff -r1.7 cw.c 1a2,23 > * Copyright (c) 2004, Sun Microsystems, Inc. > * > * Permission to use, copy, modify, distribute, and sell this software and its > * documentation for any purpose is hereby granted without fee, provided that > * the above copyright notice appear in all copies and that both that > * copyright notice and this permission notice appear in supporting > * documentation. > * > * The above copyright notice and this permission notice shall be included in > * all copies or substantial portions of the Software. > * > * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > * OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN > * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN > * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. > * > * Except as contained in this notice, the name of The Open Group shall not be > * used in advertising or otherwise to promote the sale, use or other dealings > * in this Software without prior written authorization from The Open Group. > * 176a199,200 > (pPriv->wrapFuncs = (pGC)->funcs), \ > (pPriv->wrapOps = (pGC)->ops), \ 681a706,710 > > #ifdef LG3D > SCREEN_EPILOGUE(pScreen, MoveWindow, lg3dMoveWindow); > SCREEN_EPILOGUE(pScreen, ResizeWindow, lg3dSlideAndSizeWindow); > #endif /* LG3D */ 705a735,739 > #ifdef LG3D > pScreen->MoveWindow = pScreenPriv->MoveWindow; > pScreen->ResizeWindow = pScreenPriv->ResizeWindow; > #endif /* LG3D */ > Index: programs/Xserver/composite/cw.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/composite/cw.h,v retrieving revision 1.5 diff -r1.5 cw.h 1a2,23 > * Copyright (c) 2004, Sun Microsystems, Inc. > * > * Permission to use, copy, modify, distribute, and sell this software and its > * documentation for any purpose is hereby granted without fee, provided that > * the above copyright notice appear in all copies and that both that > * copyright notice and this permission notice appear in supporting > * documentation. > * > * The above copyright notice and this permission notice shall be included in > * all copies or substantial portions of the Software. > * > * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > * OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN > * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN > * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. > * > * Except as contained in this notice, the name of The Open Group shall not be > * used in advertising or otherwise to promote the sale, use or other dealings > * in this Software without prior written authorization from The Open Group. > * 88a111,116 > > #ifdef LG3D > MoveWindowProcPtr MoveWindow; > ResizeWindowProcPtr ResizeWindow; > #endif /* LG3D */ > 145a174,179 > > #ifdef LG3D > /* lg3dwindow.c */ > extern void lg3dMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind); > extern void lg3dSlideAndSizeWindow (WindowPtr pWin, int x, int y, int w, int h, WindowPtr pSib); > #endif /* LG3D */ Index: programs/Xserver/composite/cw_ops.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/composite/cw_ops.c,v retrieving revision 1.3 diff -r1.3 cw_ops.c 46,48c46,47 < pGCPrivate->wrapOps = (pGC)->ops; \ < (pGC)->ops = &cwGCOps; \ < (pGC)->funcs = oldFuncs; \ --- > pGCPrivate->wrapOps = pGC->ops; \ > pGC->ops = &cwGCOps; \ Index: programs/Xserver/dix/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/dix/Imakefile,v retrieving revision 1.2 diff -r1.2 Imakefile 23c23,24 < tables.c window.c initatoms.c dixfonts.c privates.c pixmap.c $(FFS_SRC) --- > tables.c window.c initatoms.c dixfonts.c privates.c pixmap.c $(FFS_SRC) \ > ds.c socketpicker.c xytosubwin.c 27c28,29 < tables.o window.o initatoms.o dixfonts.o privates.o pixmap.o $(FFS_OBJ) --- > tables.o window.o initatoms.o dixfonts.o privates.o pixmap.o $(FFS_OBJ) \ > ds.o socketpicker.o xytosubwin.o Index: events.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/dix/events.c,v retrieving revision 1.6 diff -r1.6 events.c 4a5,26 > Copyright (c) 2004, Sun Microsystems, Inc. > > Permission to use, copy, modify, distribute, and sell this software and its > documentation for any purpose is hereby granted without fee, provided that > the above copyright notice appear in all copies and that both that > copyright notice and this permission notice appear in supporting > documentation. > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN > AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN > CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. > > Except as contained in this notice, the name of The Open Group shall not be > used in advertising or otherwise to promote the sale, use or other dealings > in this Software without prior written authorization from The Open Group. > 130a153,160 > #ifdef LG3D > #include "damagewire.h" > #include "../Xext/lgeint.h" > > extern int lgeTryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, > Mask filter, GrabPtr grab); > #endif /* LG3D */ > 193a224,229 > #ifdef LG3D > WindowPtr *spriteTrace = (WindowPtr *)NULL; > #define ROOT spriteTrace[0] > int spriteTraceSize = 0; > int spriteTraceGood; > #else 197a234 > #endif /* LG3D */ 218a256,264 > #ifdef LG3D > typedef struct virtual_sprite { > WindowPtr win; /* The top-level window the sprite is in (or PRW) */ > HotSpot hot; /* Sprite location relative to win */ > } VirtualSprite; > > static VirtualSprite virtualSprite; > #endif /* LG3D */ > 287a334,360 > #ifdef LG3D > > #define LG3D_DECLARE_WINDOW() \ > WindowPtr pEventWin = NULL > > #define LG3D_GET_WINDOW(e) \ > if ((e) != NULL) { \ > pEventWin = (WindowPtr) LookupIDByType((e)->u.keyButtonPointer.event, RT_WINDOW); \ > } > > /* > ** In LG Event Mode the sprite hotspot is calculated by taking the > ** event window local coordinates and converting them to screen > ** absolute. > ** > */ > #define LG3D_CALC_SPRITE_HOTXY(e) \ > sprite.hot.x = (e)->u.keyButtonPointer.rootX; \ > sprite.hot.y = (e)->u.keyButtonPointer.rootY; > > extern WindowPtr XYToSubWindow (WindowPtr pWin, int x, int y, > int *xWinRel, int *yWinRel); > > extern Bool PointInBorderSize(WindowPtr pWin, int x, int y); > > #endif /* LG3D */ > 427a501,510 > #ifdef LG3D > if (lgeDisplayServerIsAlive) { > LG3D_DECLARE_WINDOW(); > LG3D_GET_WINDOW(qe->event); > LG3D_CALC_SPRITE_HOTXY(qe->event); > } else { > sprite.hot.x = qe->event->u.keyButtonPointer.rootX; > sprite.hot.y = qe->event->u.keyButtonPointer.rootY; > } > #else 429a513 > #endif /* LG3D */ 596a681,688 > #ifdef LG3D > if (plgeDisplayServerForceThisCursor != NULL) { > (*sprite.hotPhys.pScreen->DisplayCursor) (sprite.hotPhys.pScreen, > plgeDisplayServerForceThisCursor); > return; > } > #endif /* LG3D */ > 831a924,931 > #ifdef LG3D > if (plgeDisplayServerForceThisCursor != NULL) { > (*sprite.hotPhys.pScreen->DisplayCursor) (sprite.hotPhys.pScreen, > plgeDisplayServerForceThisCursor); > return; > } > #endif /* LG3D */ > 954a1055,1166 > #ifdef LG3D > > #define SEND_TO_ALLGRAB_CLIENT 0 > #define SEND_TO_NORMAL_CLIENT 1 > #define SEND_TO_BOTH_CLIENTS 2 > > /* > ** Given an event, returns a code specifying to whom the event > ** should be sent. In the case where DS cares, this routine returns the event's > ** destination window in the win argument. > */ > > static int > lgeDSCaresAboutEvent (xEvent *pEvent, Window *win) > { > int dest; > > switch (pEvent->u.u.type) { > > case KeyPress: > case KeyRelease: > case ButtonPress: > case ButtonRelease: > case MotionNotify: > *win = pEvent->u.keyButtonPointer.event; > dest = SEND_TO_ALLGRAB_CLIENT; > break; > > case EnterNotify: > case LeaveNotify: > *win = pEvent->u.enterLeave.event; > dest = SEND_TO_ALLGRAB_CLIENT; > break; > > case FocusIn: > case FocusOut: > dest = SEND_TO_ALLGRAB_CLIENT; > *win = pEvent->u.focus.window; > break; > > case ConfigureNotify: > dest = SEND_TO_BOTH_CLIENTS; > *win = pEvent->u.configureNotify.window; > break; > > default: > /* The above events are the only one the DS cares about */ > /* Note: XDamageNotify is handled specially by client == NULL */ > dest = SEND_TO_NORMAL_CLIENT; > } > > return dest; > } > > /* > ** If lgeGrabAllWindowEvents is active, send all events that the > ** LG DS cares that are destined for the grab window to the grab client. > ** > ** HACK ALERT: the current lgeGrabAllWindowEvents is somewhat of a hack. It > ** was done because there is no method in the standard X11 protocol for > ** directing all events to a particular client. The main reason why this > ** is necessary in LG3D is because there are problems in the Display Server > ** with Java AWT. The first problem is that X display connections in multiple > ** threads don't work properly (or, at least, we couldn't get it to work). > ** The second is that eventually AWT needs to be upgraded to handle extension > ** events such as DamageNotify and CursorImageNotify. There wasn't time to do > ** this, so we opted to use lgeGrabAllWindowEvents to keep events from going > ** to AWT at all. > */ > > int > lgeTryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, > Mask filter, GrabPtr grab) > { > int status = 1; > int i; > > if (!lgeGrabAllWindowEvents.active) { > return TryClientEvents (client, pEvents, count, mask, filter, grab); > } > > for (i = 0; i < count; i++) { > Window win; > int destination; > > destination = lgeDSCaresAboutEvent (pEvents, &win); > > if (client == NULL /* For XDamageNotify */ || > (destination != SEND_TO_NORMAL_CLIENT && win == lgeGrabAllWindowEvents.window)) { > /* > ** Send events to grabbing client client. Use a null grab pointer > ** in order to sure that the event isn't eaten by any grabs; we want > ** all input events to get to be sent to the all-grab client. > */ > status = TryClientEvents (lgeGrabAllWindowEvents.pClient, pEvents, 1, > mask, filter, NULL); > /*ErrorF("Sent to allgrab client, type = %d\n", pEvents->u.u.type);*/ > if (destination == SEND_TO_BOTH_CLIENTS) { > status = TryClientEvents (client, pEvents, 1, mask, filter, grab); > } > } else { > /* Send events to normal destination client only*/ > status = TryClientEvents (client, pEvents, 1, mask, filter, grab); > } > > pEvents++; > } > > return status; > } > #endif /* LG3D */ > 1610a1823,1826 > #ifdef LG3D > if ( (attempt = lgeTryClientEvents(wClient(pWin), pEvents, count, > pWin->eventMask, filter, grab)) ) > #else 1612a1829 > #endif /* LG3D */ 1638a1856,1859 > #ifdef LG3D > if ( (attempt = lgeTryClientEvents(rClient(other), pEvents, count, > other->mask[mskidx], filter, grab)) ) > #else 1640a1862 > #endif /* LG3D */ 1730a1953,1956 > #ifdef LG3D > return lgeTryClientEvents(wClient(pWin), pEvents, count, > pWin->eventMask, filter, NullGrab); > #else 1732a1959 > #endif /* LG3D */ 1744a1972,1975 > #ifdef LG3D > return lgeTryClientEvents(rClient(other), pEvents, count, > other->mask, filter, NullGrab); > #else 1746a1978 > #endif /* LG3D */ 1758a1991,1995 > #ifdef LG3D > Bool isMouseEvent = FALSE; > Window mouseEventWinPrev = 0; > #endif /* LG3D */ > 1786a2024,2052 > #ifdef LG3D > if (xE->u.u.type == ButtonPress || > xE->u.u.type == ButtonRelease || > xE->u.u.type == MotionNotify) { > isMouseEvent = TRUE; > mouseEventWinPrev = XE_KBPTR.event; > } > > if (lgeDisplayServerIsAlive && > XE_KBPTR.event == lgeDisplayServerPRW) { > > /* > ** Event is going to the PRW. > ** Button and motion events already have the event > ** window field set. > */ > if (!isMouseEvent) { > XE_KBPTR.event = pWin->drawable.id; > } > > } else { > /* > ** Non-LG event mode or the event is going to an > ** X application window. Need to set the event window > ** field to the destination window. > */ > XE_KBPTR.event = pWin->drawable.id; > } > #else 1787a2054 > #endif /* LG3D */ 1791a2059,2105 > #ifdef LG3D > if (lgeDisplayServerIsAlive) { > if (XE_KBPTR.event == lgeDisplayServerPRW) { > /* > ** Event is going to the PRW. > ** Button and motion events already have the event > ** XY fields set. > */ > if (!isMouseEvent) { > XE_KBPTR.eventX = XE_KBPTR.rootX; > XE_KBPTR.eventY = XE_KBPTR.rootY; > } > } else { > /* > ** Event is going to an X application > ** window. Need to set the window relative event XY for > ** ALL event types. > ** > ** TODO: I don't think this code deals very well with grab cases, > */ > if (!isMouseEvent || mouseEventWinPrev == pWin->drawable.id) { > /* > ** A non-button/motion event (e.g. keypress or enter/leave) > ** or the event occurred in a top-level window. > ** Do nothing. The event coords are already correct. > */ > } else { > /* TODO: it would be good to avoid a resource lookup here */ > WindowPtr pOuterWin = (WindowPtr) LookupIDByType(mouseEventWinPrev, RT_WINDOW); > if (pOuterWin == NULL) { > ErrorF("Error: FixupEventFromWindow: outer window %d, not found. No XY fix up occuring.\n", mouseEventWinPrev); > } else { > /* > ** Make the event coords relative to the destination window > ** instead of relative to the outer window. > */ > XE_KBPTR.eventX -= pWin->drawable.x - pOuterWin->drawable.x; > XE_KBPTR.eventY -= pWin->drawable.y - pOuterWin->drawable.y; > } > } > } > } else { > /* Non-LG event mode */ > XE_KBPTR.eventX = XE_KBPTR.rootX - pWin->drawable.x; > XE_KBPTR.eventY = XE_KBPTR.rootY - pWin->drawable.y; > } > #else 1795a2110 > #endif /* LG3D */ 1838a2154,2166 > #ifdef LG3D > /* > ** Stop propogating when the parent of the window is the PRW. > ** This prevents events that are not caught by any X11 window from > ** being sent back to the the Display Server, because the DS can > ** misinterpret these. > ** TODO: we need to decide if a server change is the best way to > ** deal with this problem, or whether the DS or WM can do something > ** about it. > */ > (lgeDisplayServerIsAlive && > pWin->parent->drawable.id == lgeDisplayServerPRW) || > #endif /* LG3D */ 1863a2192,2196 > #ifdef LG3D > /* See comment above */ > (lgeDisplayServerIsAlive && > pWin->parent->drawable.id == lgeDisplayServerPRW) || > #endif /* LG3D */ 1914a2248,2250 > #ifdef LG3D > Bool > #else 1915a2252 > #endif /* LG3D */ 1985a2323,2328 > #ifdef LG3D > LG3D_DECLARE_WINDOW(); > if (lgeDisplayServerIsAlive) { > LG3D_GET_WINDOW(xE); > } > #endif /* LG3D */ 1998a2342,2349 > #ifdef LG3D > if (lgeDisplayServerIsAlive) { > LG3D_CALC_SPRITE_HOTXY(xE); > } else { > sprite.hot.x = XE_KBPTR.rootX; > sprite.hot.y = XE_KBPTR.rootY; > } > #else 2000a2352 > #endif /* LG3D */ 2024a2377,2406 > #ifdef LG3D > if (pEventWin == NULL) { > sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y); > virtualSprite.hot.x = sprite.hot.x - sprite.win->drawable.x; > virtualSprite.hot.y = sprite.hot.y - sprite.win->drawable.y; > } else { > WindowPtr pSpriteWin; > > /* > ** This is needed to decouple the virtual sprite position from > ** the physical sprite position. > */ > if (pEventWin->drawable.id == lgeDisplayServerPRW) { > pSpriteWin = pEventWin; > virtualSprite.hot.x = sprite.hot.x; > virtualSprite.hot.y = sprite.hot.y; > } else { > pSpriteWin = XYToSubWindow(pEventWin, > xE->u.keyButtonPointer.eventX, > xE->u.keyButtonPointer.eventY, > &virtualSprite.hot.x, > &virtualSprite.hot.y); > } > > sprite.win = pSpriteWin; > } > > virtualSprite.win = sprite.win; > > #else 2025a2408,2409 > #endif /* LG3D */ > 2474a2859,2863 > #ifdef LG3D > (void) lgeTryClientEvents(rClient(grab), xE, count, > filters[xE->u.u.type], > filters[xE->u.u.type], grab); > #else 2477a2867 > #endif /* LG3D */ 2628a3019,3023 > #ifdef LG3D > deliveries = lgeTryClientEvents(rClient(grab), xE, count, > (Mask)grab->eventMask, > filters[xE->u.u.type], grab); > #else 2631a3027 > #endif /* LG3D */ 3268a3665,3668 > #ifdef LG3D > (void)lgeTryClientEvents(rClient(grab), &event, 1, mask, > filters[type], grab); > #else 3270a3671 > #endif /* LG3D */ 3290a3692,3695 > #ifdef LG3D > (void)lgeTryClientEvents(rClient(grab), (xEvent *)&ke, 1, mask, > KeymapStateMask, grab); > #else 3292a3698 > #endif /* LG3D */ 3992a4399,4411 > #ifdef LG3D > /* > ** TODO: this only works when pWin is the top-level > ** window (or a descendent of the top level window) > ** of the current virtual sprite window. We haven't > ** yet figured out what the semantics should be for > ** the case where this is not true. > */ > rep.winX = virtualSprite.win->drawable.x + virtualSprite.hot.x - > pWin->drawable.x; > rep.winY = virtualSprite.win->drawable.y + virtualSprite.hot.y - > pWin->drawable.y; > #else 3994a4414 > #endif /* LG3D */ 4548a4969,4975 > #if defined(LG3D) && defined (DEBUG) > int print_events_all = 1; > int print_events_to_ds = 0; > int print_events_to_wm = 0; > int print_events_to_app = 0; > #endif /* LG3D && DEBUG */ > 4607a5035,5052 > > #if defined(LG3D) && defined (DEBUG) > if (print_events_all || > (print_events_to_ds && pClient->index == 4) || > (print_events_to_wm && pClient->index == 5) || > (print_events_to_app && pClient->index == 6)) { > xEvent *ev; > > for(i = 0; i < count; i++) { > ev = &events[i]; > ErrorF("Send event %d to client %d, xy = %d, %d, event win = %d\n", > ev->u.u.type, pClient->index, > ev->u.keyButtonPointer.eventX, ev->u.keyButtonPointer.eventY, > ev->u.keyButtonPointer.event); > } > } > #endif /* LG3D && DEBUG */ Index: programs/Xserver/dix/window.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/dix/window.c,v retrieving revision 1.6 diff -r1.6 window.c 4a5,26 > Copyright (c) 2004, Sun Microsystems, Inc. > > Permission to use, copy, modify, distribute, and sell this software and its > documentation for any purpose is hereby granted without fee, provided that > the above copyright notice appear in all copies and that both that > copyright notice and this permission notice appear in supporting > documentation. > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN > AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN > CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. > > Except as contained in this notice, the name of The Open Group shall not be > used in advertising or otherwise to promote the sale, use or other dealings > in this Software without prior written authorization from The Open Group. > 110a133,136 > #ifdef LG3D > #include "../Xext/lgeint.h" > #endif /* LG3D */ > 1387a1414,1419 > #ifdef LG3D > /* Nullify the cursor of the PRW */ > if (lgeDisplayServerIsAlive && pWin->drawable.id == lgeDisplayServerPRW) { > cursorID = None; > } > #endif /* LG3D */ 2239a2272,2274 > #ifdef LG3D > Bool redirToWm; > #endif /* LG3D */ 2339a2375,2385 > #ifdef LG3D > /* TODO: RedirectSend is not always true for prw; I don't know why. */ > redirToWm = RedirectSend(pParent) || (pParent->drawable.id == lgeDisplayServerPRW); > > /* Don't send the LG wm notifications about InputOnly windows */ > redirToWm = redirToWm && (pWin->drawable.class == InputOutput); > > /* Note: even send notifications for override redirect window */ > > if ((redirToWm > #else 2341a2388 > #endif /* LG3D */ 2724a2772,2774 > #ifdef LG3D > Bool redirToWm; > #endif /* LG3D */ 2748a2799,2809 > #ifdef LG3D > /* TODO: RedirectSend is not always true for prw; I don't know why. */ > redirToWm = RedirectSend(pParent) || (pParent->drawable.id == lgeDisplayServerPRW); > > /* Don't send the LG wm notifications about InputOnly windows */ > redirToWm = redirToWm && (pWin->drawable.class == InputOutput); > > /* Note: even send notifications for override redirect window */ > > if ((redirToWm > #else 2750a2812 > #endif /* LG3D */ 2859a2922,2924 > #ifdef LG3D > Bool redirToWm; > #endif /* LG3D */ Index: programs/Xserver/hw/xfree86/common/xf86Xinput.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c,v retrieving revision 1.1.1.2 diff -r1.1.1.2 xf86Xinput.c 2a3,24 > * Copyright (c) 2004, Sun Microsystems, Inc. > * > * Permission to use, copy, modify, distribute, and sell this software and its > * documentation for any purpose is hereby granted without fee, provided that > * the above copyright notice appear in all copies and that both that > * copyright notice and this permission notice appear in supporting > * documentation. > * > * The above copyright notice and this permission notice shall be included in > * all copies or substantial portions of the Software. > * > * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > * OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN > * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN > * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. > * > * Except as contained in this notice, the name of The Open Group shall not be > * used in advertising or otherwise to promote the sale, use or other dealings > * in this Software without prior written authorization from The Open Group. > * 91a114,117 > #ifdef LG3D > # include "../../../dix/ds.h" > #endif /* LG3D */ > 709a736,739 > #ifdef LG3D > dsProcessEvent(e); > #endif /* LG3D */ > Index: programs/Xserver/include/globals.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/include/globals.h,v retrieving revision 1.4 diff -r1.4 globals.h 63a64,67 > #ifdef LG3D > extern Bool noLgeExtension; > #endif > Index: programs/Xserver/mi/miinitext.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/mi/miinitext.c,v retrieving revision 1.11 diff -r1.11 miinitext.c 4a5,26 > Copyright (c) 2004, Sun Microsystems, Inc. > > Permission to use, copy, modify, distribute, and sell this software and its > documentation for any purpose is hereby granted without fee, provided that > the above copyright notice appear in all copies and that both that > copyright notice and this permission notice appear in supporting > documentation. > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN > AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN > CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. > > Except as contained in this notice, the name of The Open Group shall not be > used in advertising or otherwise to promote the sale, use or other dealings > in this Software without prior written authorization from The Open Group. > 88a111 > #undef LG3D 106a130,132 > #ifdef LG3D > extern Bool noLgeExtension; > #endif /* LG3D */ 290a317,319 > #ifdef LG3D > extern void LgeExtensionInit(INITARGS); > #endif 317a347,349 > #ifdef LG3D > { "LGE", &noLgeExtension }, > #endif /* LG3D */ 498a531,533 > #ifdef LG3D > if (!noLgeExtension) LgeExtensionInit(); > #endif 634a670,672 > #ifdef LG3D > { LgeExtensionInit, "LGE", &noLgeExtension, NULL }, > #endif Index: programs/Xserver/mi/mivaltree.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/mi/mivaltree.c,v retrieving revision 1.3 diff -r1.3 mivaltree.c 8a9,30 > Copyright (c) 2004, Sun Microsystems, Inc. > > Permission to use, copy, modify, distribute, and sell this software and its > documentation for any purpose is hereby granted without fee, provided that > the above copyright notice appear in all copies and that both that > copyright notice and this permission notice appear in supporting > documentation. > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN > AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN > CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. > > Except as contained in this notice, the name of The Open Group shall not be > used in advertising or otherwise to promote the sale, use or other dealings > in this Software without prior written authorization from The Open Group. > 104a127,130 > #ifdef LG3D > #include "../Xext/lgeint.h" > #endif /* LG3D */ > 616a643,663 > #ifdef LG3D > /* Never update the parent clips of a redirected window */ > Bool okayToUpdateParent = !pChild->redirectDraw; > > /* > ** In order to avoid updating the parent clips, save them > ** and restore them afterwards. > ** TODO: alternatively, we could update every place within > ** mivaltree.c where these are written and prevent the write. > */ > RegionRec parentClipListSave; > RegionRec parentBorderClipSave; > > if (!okayToUpdateParent) { > REGION_NULL(pScreen, &parentClipListSave); > REGION_NULL(pScreen, &parentBorderClipSave); > REGION_COPY(pScreen, &parentClipListSave, &pParent->clipList); > REGION_COPY(pScreen, &parentBorderClipSave, &pParent->borderClip); > } > #endif /* LG3D */ > 818a866,874 > > #ifdef LG3D > /* > ** It is necessary to skip this when LG3D is active because this causes a > ** WID hole when some windows are unmapped (at least on some DDX's, such > ** as Nvidia). TODO: I'm not really sure why this works. > */ > if (pScreen->ClipNotify && !lgeDisplayServerIsAlive) > #else 819a876 > #endif /* LG3D */ 820a878,887 > > #ifdef LG3D > if (!okayToUpdateParent) { > REGION_COPY(pScreen, &pParent->clipList, &parentClipListSave); > REGION_COPY(pScreen, &pParent->borderClip, &parentBorderClipSave); > REGION_UNINIT(pScreen, &parentClipListSave); > REGION_UNINIT(pScreen, &parentBorderClipSave); > } > #endif /* LG3D */ > Index: programs/Xserver/miext/damage/damage.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/miext/damage/damage.c,v retrieving revision 1.6 diff -r1.6 damage.c 3a4,25 > * Copyright (c) 2004, Sun Microsystems, Inc. > * > * Permission to use, copy, modify, distribute, and sell this software and its > * documentation for any purpose is hereby granted without fee, provided that > * the above copyright notice appear in all copies and that both that > * copyright notice and this permission notice appear in supporting > * documentation. > * > * The above copyright notice and this permission notice shall be included in > * all copies or substantial portions of the Software. > * > * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > * OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN > * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN > * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. > * > * Except as contained in this notice, the name of The Open Group shall not be > * used in advertising or otherwise to promote the sale, use or other dealings > * in this Software without prior written authorization from The Open Group. > * 1518a1541,1553 > #ifdef LG3D > /* > ** RUDE HACK: need to find a cleaner way to do this! > ** This variable is set by routines in lgwindow.c > ** in order to skip the wrappee paint window call from > ** this routine. This is necessary in order to keep the > ** DDX from preparing the DIDs where the X server thinks > ** the window is. But this isn't where the 3D window > ** avatar really is. > */ > Bool damagePaintWindowCallWrappee = TRUE; > #endif /* LG3D */ > 1533a1569,1574 > > #ifdef LG3D > /* RUDE HACK: see comment above */ > if (damagePaintWindowCallWrappee) { > #endif /* LG3D */ > 1542a1584,1588 > > #ifdef LG3D > /* RUDE HACK: see comment above */ > } > #endif /* LG3D */ Index: programs/Xserver/os/utils.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/os/utils.c,v retrieving revision 1.6 diff -r1.6 utils.c 148a149,152 > #ifdef LG3D > Bool noLgeExtension = TRUE; > #endif
Created attachment 614 [details] CVS diffs for LG3D-modified Xorg and Xorg 6.8 as of Wed Aug 11 21:19:21 PDT 2004
All diffs should really be in unified diff format for clarity (diff -u). This patch seems kindof hackish IMHO.
Request withdrawn. I will integrate the LG3D code into a branch.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.