aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-10-14 13:54:23 +0000
committermarha <marha@users.sourceforge.net>2010-10-14 13:54:23 +0000
commit579eaaac4679bf78b1d987a56f4a24e7cf616368 (patch)
tree53977d03cd6af212b3605ae3906d5e499e6d960e
parentbc5113fca69c8b05861a011426a4611985495cfe (diff)
parentd621ea397a3d181e7a0bf07d72bd21e116fccdb8 (diff)
downloadvcxsrv-579eaaac4679bf78b1d987a56f4a24e7cf616368.tar.gz
vcxsrv-579eaaac4679bf78b1d987a56f4a24e7cf616368.tar.bz2
vcxsrv-579eaaac4679bf78b1d987a56f4a24e7cf616368.zip
svn merge ^/branches/released .
-rw-r--r--xorg-server/dix/devices.c2
-rw-r--r--xorg-server/dix/dispatch.c13
-rw-r--r--xorg-server/dix/dixutils.c9
-rw-r--r--xorg-server/dix/enterleave.c13
-rw-r--r--xorg-server/dix/events.c76
-rw-r--r--xorg-server/fb/wfbrename.h2
-rw-r--r--xorg-server/hw/xwin/winfillsp.c35
-rw-r--r--xorg-server/hw/xwin/wingetsp.c342
-rw-r--r--xorg-server/hw/xwin/winsetsp.c8
-rw-r--r--xorg-server/include/callback.h185
-rw-r--r--xorg-server/include/dix.h2
-rw-r--r--xorg-server/include/pixmap.h6
-rw-r--r--xorg-server/test/Makefile.am83
13 files changed, 350 insertions, 426 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index b124a7da4..338819e8d 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -2438,7 +2438,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
WindowPtr currentRoot;
if (dev->spriteInfo->sprite)
- currentRoot = dev->spriteInfo->sprite->spriteTrace[0];
+ currentRoot = GetCurrentRootWindow(dev);
else /* new device auto-set to floating */
currentRoot = screenInfo.screens[0]->root;
diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c
index 3a6549185..6b1a20eae 100644
--- a/xorg-server/dix/dispatch.c
+++ b/xorg-server/dix/dispatch.c
@@ -944,23 +944,14 @@ GetGeometry(ClientPtr client, xGetGeometryReply *rep)
rep->width = pDraw->width;
rep->height = pDraw->height;
- /* XXX - Because the pixmap-implementation of the multibuffer extension
- * may have the buffer-id's drawable resource value be a pointer
- * to the buffer's window instead of the buffer itself
- * (this happens if the buffer is the displayed buffer),
- * we also have to check that the id matches before we can
- * truly say that it is a DRAWABLE_WINDOW.
- */
-
- if ((pDraw->type == UNDRAWABLE_WINDOW) ||
- ((pDraw->type == DRAWABLE_WINDOW) && (stuff->id == pDraw->id)))
+ if (WindowDrawable(pDraw->type))
{
WindowPtr pWin = (WindowPtr)pDraw;
rep->x = pWin->origin.x - wBorderWidth (pWin);
rep->y = pWin->origin.y - wBorderWidth (pWin);
rep->borderWidth = pWin->borderWidth;
}
- else /* DRAWABLE_PIXMAP or DRAWABLE_BUFFER */
+ else /* DRAWABLE_PIXMAP */
{
rep->x = rep->y = rep->borderWidth = 0;
}
diff --git a/xorg-server/dix/dixutils.c b/xorg-server/dix/dixutils.c
index d9d9d8c7d..c23c87e9a 100644
--- a/xorg-server/dix/dixutils.c
+++ b/xorg-server/dix/dixutils.c
@@ -729,7 +729,7 @@ _DeleteCallback(
return FALSE;
}
-static void
+void
_CallCallbacks(
CallbackListPtr *pcbl,
pointer call_data)
@@ -871,13 +871,6 @@ DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data)
}
void
-CallCallbacks(CallbackListPtr *pcbl, pointer call_data)
-{
- if (!pcbl || !*pcbl) return;
- _CallCallbacks(pcbl, call_data);
-}
-
-void
DeleteCallbackList(CallbackListPtr *pcbl)
{
if (!pcbl || !*pcbl) return;
diff --git a/xorg-server/dix/enterleave.c b/xorg-server/dix/enterleave.c
index 417aa2639..6be14190f 100644
--- a/xorg-server/dix/enterleave.c
+++ b/xorg-server/dix/enterleave.c
@@ -1251,11 +1251,6 @@ CoreFocusEvents(DeviceIntPtr dev,
SetFocusIn(dev, to);
}
-/**
- * The root window the given device is currently on.
- */
-#define RootWindow(dev) dev->spriteInfo->sprite->spriteTrace[0]
-
static void
DeviceFocusEvents(DeviceIntPtr dev,
WindowPtr from,
@@ -1284,7 +1279,7 @@ DeviceFocusEvents(DeviceIntPtr dev,
if ((from == NullWindow) || (from == PointerRootWin))
{
if (from == PointerRootWin)
- DeviceFocusOutEvents(dev, sprite->win, RootWindow(dev), mode,
+ DeviceFocusOutEvents(dev, sprite->win, GetCurrentRootWindow(dev), mode,
NotifyPointer);
/* Notify all the roots */
for (i = 0; i < nscreens; i++)
@@ -1304,19 +1299,19 @@ DeviceFocusEvents(DeviceIntPtr dev,
for (i = 0; i < nscreens; i++)
DeviceFocusEvent(dev, XI_FocusIn, mode, in, screenInfo.screens[i]->root);
if (to == PointerRootWin)
- DeviceFocusInEvents(dev, RootWindow(dev), sprite->win, mode, NotifyPointer);
+ DeviceFocusInEvents(dev, GetCurrentRootWindow(dev), sprite->win, mode, NotifyPointer);
}
else
{
if ((from == NullWindow) || (from == PointerRootWin))
{
if (from == PointerRootWin)
- DeviceFocusOutEvents(dev, sprite->win, RootWindow(dev), mode,
+ DeviceFocusOutEvents(dev, sprite->win, GetCurrentRootWindow(dev), mode,
NotifyPointer);
for (i = 0; i < nscreens; i++)
DeviceFocusEvent(dev, XI_FocusOut, mode, out, screenInfo.screens[i]->root);
if (to->parent != NullWindow)
- DeviceFocusInEvents(dev, RootWindow(dev), to, mode, NotifyNonlinearVirtual);
+ DeviceFocusInEvents(dev, GetCurrentRootWindow(dev), to, mode, NotifyNonlinearVirtual);
DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyNonlinear, to);
if (IsParent(to, sprite->win))
DeviceFocusInEvents(dev, to, sprite->win, mode, NotifyPointer);
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index 115bce82b..41faa65f9 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -1279,7 +1279,6 @@ static void
ComputeFreezes(void)
{
DeviceIntPtr replayDev = syncEvents.replayDev;
- int i;
WindowPtr w;
GrabPtr grab;
DeviceIntPtr dev;
@@ -1297,29 +1296,15 @@ ComputeFreezes(void)
syncEvents.replayDev = (DeviceIntPtr)NULL;
w = XYToWindow(replayDev, event->root_x, event->root_y);
- for (i = 0; i < replayDev->spriteInfo->sprite->spriteTraceGood; i++)
- {
- if (syncEvents.replayWin ==
- replayDev->spriteInfo->sprite->spriteTrace[i])
- {
- if (!CheckDeviceGrabs(replayDev, event, i+1)) {
- if (replayDev->focus && !IsPointerEvent((InternalEvent*)event))
- DeliverFocusedEvent(replayDev, (InternalEvent*)event, w);
- else
- DeliverDeviceEvents(w, (InternalEvent*)event, NullGrab,
- NullWindow, replayDev);
- }
- goto playmore;
- }
- }
- /* must not still be in the same stack */
- if (replayDev->focus && !IsPointerEvent((InternalEvent*)event))
- DeliverFocusedEvent(replayDev, (InternalEvent*)event, w);
- else
- DeliverDeviceEvents(w, (InternalEvent*)event, NullGrab,
- NullWindow, replayDev);
+ if (!CheckDeviceGrabs(replayDev, event, syncEvents.replayWin))
+ {
+ if (replayDev->focus && !IsPointerEvent((InternalEvent*)event))
+ DeliverFocusedEvent(replayDev, (InternalEvent*)event, w);
+ else
+ DeliverDeviceEvents(w, (InternalEvent*)event, NullGrab,
+ NullWindow, replayDev);
+ }
}
-playmore:
for (dev = inputInfo.devices; dev; dev = dev->next)
{
if (!dev->deviceGrab.sync.frozen)
@@ -2651,11 +2636,11 @@ ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
BOOL rc = FALSE;
DeviceEvent event;
- if (dev->deviceGrab.grab &&
- dev->deviceGrab.fromPassiveGrab &&
- dev->deviceGrab.grab->type == XI_Enter)
+ if (dev->deviceGrab.grab)
{
- if (dev->deviceGrab.grab->window == win ||
+ if (!dev->deviceGrab.fromPassiveGrab ||
+ dev->deviceGrab.grab->type != XI_Enter ||
+ dev->deviceGrab.grab->window == win ||
IsParent(dev->deviceGrab.grab->window, win))
return FALSE;
DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab);
@@ -2691,11 +2676,11 @@ ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
BOOL rc = FALSE;
DeviceEvent event;
- if (dev->deviceGrab.grab &&
- dev->deviceGrab.fromPassiveGrab &&
- dev->deviceGrab.grab->type == XI_Enter)
+ if (dev->deviceGrab.grab)
{
- if (dev->deviceGrab.grab->window == win ||
+ if (!dev->deviceGrab.fromPassiveGrab ||
+ dev->deviceGrab.grab->type != XI_Enter ||
+ dev->deviceGrab.grab->window == win ||
IsParent(dev->deviceGrab.grab->window, win))
return FALSE;
DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab);
@@ -3409,9 +3394,6 @@ CheckPassiveGrabsOnWindow(
#define XI2_MATCH 0x4
int match = 0;
- if (device->deviceGrab.grab)
- return FALSE;
-
if (!grab)
return FALSE;
/* Fill out the grab details, but leave the type for later before
@@ -3620,7 +3602,7 @@ CheckPassiveGrabsOnWindow(
*/
Bool
-CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, int checkFirst)
+CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, WindowPtr ancestor)
{
int i;
WindowPtr pWin = NULL;
@@ -3635,30 +3617,38 @@ CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, int checkFirst)
&& (device->button->buttonsDown != 1))
return FALSE;
- i = checkFirst;
+ if (device->deviceGrab.grab)
+ return FALSE;
+
+ i = 0;
+ if (ancestor)
+ {
+ while (i < device->spriteInfo->sprite->spriteTraceGood)
+ if (device->spriteInfo->sprite->spriteTrace[i++] == ancestor)
+ break;
+ if (i == device->spriteInfo->sprite->spriteTraceGood)
+ return FALSE;
+ }
if (focus)
{
for (; i < focus->traceGood; i++)
{
pWin = focus->trace[i];
- if (pWin->optional &&
- CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))
+ if (CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))
return TRUE;
}
if ((focus->win == NoneWin) ||
(i >= device->spriteInfo->sprite->spriteTraceGood) ||
- ((i > checkFirst) &&
- (pWin != device->spriteInfo->sprite->spriteTrace[i-1])))
+ (pWin && pWin != device->spriteInfo->sprite->spriteTrace[i-1]))
return FALSE;
}
for (; i < device->spriteInfo->sprite->spriteTraceGood; i++)
{
pWin = device->spriteInfo->sprite->spriteTrace[i];
- if (pWin->optional &&
- CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))
+ if (CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))
return TRUE;
}
@@ -5071,7 +5061,7 @@ ProcSendEvent(ClientPtr client)
/* If the input focus is PointerRootWin, send the event to where
the pointer is if possible, then perhaps propogate up to root. */
if (inputFocus == PointerRootWin)
- inputFocus = pSprite->spriteTrace[0]; /* Root window! */
+ inputFocus = RootWindow(dev);
if (IsParent(inputFocus, pSprite->win))
{
diff --git a/xorg-server/fb/wfbrename.h b/xorg-server/fb/wfbrename.h
index 9c45045e7..0d59811e1 100644
--- a/xorg-server/fb/wfbrename.h
+++ b/xorg-server/fb/wfbrename.h
@@ -155,8 +155,6 @@
#define fbReduceRasterOp wfbReduceRasterOp
#define fbReplicatePixel wfbReplicatePixel
#define fbResolveColor wfbResolveColor
-#define fbRestoreAreas wfbRestoreAreas
-#define fbSaveAreas wfbSaveAreas
#define fbScreenPrivateKeyRec wfbScreenPrivateKeyRec
#define fbSegment wfbSegment
#define fbSelectBres wfbSelectBres
diff --git a/xorg-server/hw/xwin/winfillsp.c b/xorg-server/hw/xwin/winfillsp.c
index ef427a3f1..1cc91e62a 100644
--- a/xorg-server/hw/xwin/winfillsp.c
+++ b/xorg-server/hw/xwin/winfillsp.c
@@ -824,41 +824,6 @@ winFillSpansNativeGDI (DrawablePtr pDrawable,
SelectClipRgn (pGCPriv->hdc, NULL);
break;
- case UNDRAWABLE_WINDOW:
- /* UNDRAWABLE_WINDOW doesn't appear to get called when running xterm */
- switch (pGC->fillStyle)
- {
- case FillSolid:
- ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - FillSolid - "
- "Unimplemented\n");
- break;
-
- case FillStippled:
- ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - FillStippled - "
- "Unimplemented\n");
- break;
-
- case FillTiled:
- ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - FillTiled - "
- "Unimplemented\n");
- break;
-
- case FillOpaqueStippled:
- ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - OpaqueStippled - "
- "Unimplemented\n");
- break;
-
- default:
- ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - Unknown fillStyle\n");
- break;
- }
- break;
-
- case DRAWABLE_BUFFER:
- /* DRAWABLE_BUFFER seems to be undocumented. */
- ErrorF ("winFillSpans - DRAWABLE_BUFFER - Unimplemented\n");
- break;
-
default:
ErrorF ("winFillSpans - Unknown drawable type\n");
break;
diff --git a/xorg-server/hw/xwin/wingetsp.c b/xorg-server/hw/xwin/wingetsp.c
index e9c23881f..0fd0ebce9 100644
--- a/xorg-server/hw/xwin/wingetsp.c
+++ b/xorg-server/hw/xwin/wingetsp.c
@@ -1,175 +1,167 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *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 XFREE86 PROJECT 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 XFree86 Project
- *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 XFree86 Project.
- *
- * Authors: Harold L Hunt II
- * Alan Hourihane <alanh@fairlite.demon.co.uk>
- */
-
-#ifdef HAVE_XWIN_CONFIG_H
-#include <xwin-config.h>
-#endif
-#include "win.h"
-
-/* See Porting Layer Definition - p. 55 */
-void
-winGetSpansNativeGDI (DrawablePtr pDrawable,
- int nMax,
- DDXPointPtr pPoints,
- int *piWidths,
- int iSpans,
- char *pDsts)
-{
- PixmapPtr pPixmap = NULL;
- winPrivPixmapPtr pPixmapPriv = NULL;
- int iSpan;
- DDXPointPtr pPoint = NULL;
- int *piWidth = NULL;
- char *pDst = pDsts;
- HBITMAP hbmpWindow, hbmpOrig, hbmpOrig1;
- BYTE *pbWindow = NULL;
- HDC hdcMem, hdcMem1;
- ScreenPtr pScreen = pDrawable->pScreen;
- winScreenPriv(pScreen);
-
- /* Branch on the drawable type */
- switch (pDrawable->type)
- {
- case DRAWABLE_PIXMAP:
- winDebug ("winGetSpans - DRAWABLE_PIXMAP %08x\n",
- pDrawable);
-
- pPixmap = (PixmapPtr) pDrawable;
- pPixmapPriv = winGetPixmapPriv (pPixmap);
-
- /* Open a memory HDC */
- hdcMem1 = CreateCompatibleDC (NULL);
- hdcMem = CreateCompatibleDC (NULL);
-
- /* Select the drawable pixmap into a DC */
- hbmpOrig1 = SelectObject (hdcMem1, pPixmapPriv->hBitmap);
-
- if (hbmpOrig1 == NULL)
- FatalError ("winGetSpans - DRAWABLE_PIXMAP - SelectObject () "
- "failed on pPixmapPriv->hBitmap\n");
-
- /* Loop through spans */
- for (iSpan = 0; iSpan < iSpans; ++iSpan)
- {
- pPoint = pPoints + iSpan;
- piWidth = piWidths + iSpan;
-
- hbmpWindow = winCreateDIBNativeGDI (*piWidth, 1,
- pDrawable->depth,
- &pbWindow,
- NULL);
-
- hbmpOrig = SelectObject (hdcMem, hbmpWindow);
-
- /* Transfer the window bits to the window bitmap */
- BitBlt (hdcMem,
- 0, 0,
- *piWidth, 1,
- hdcMem1,
- pPoint->x, pPoint->y,
- SRCCOPY);
-
- memcpy (pDst,
- (char*) pbWindow,
- PixmapBytePad (*piWidth, pDrawable->depth));
-
- /* Pop the window bitmap out of the HDC and delete the bitmap */
- SelectObject (hdcMem, hbmpOrig);
- DeleteObject (hbmpWindow);
-
- /* Calculate offset of next bit destination */
- pDst += PixmapBytePad (*piWidth, pDrawable->depth);
- }
-
- /* Pop the pixmap's bitmap out of the HDC */
- SelectObject (hdcMem1, hbmpOrig1);
-
- /* Delete the HDCs */
- DeleteDC (hdcMem1);
- DeleteDC (hdcMem);
- break;
-
- case DRAWABLE_WINDOW:
-
- /* Open a memory HDC */
- hdcMem = CreateCompatibleDC (NULL);
-
- /* Loop through spans */
- for (iSpan = 0; iSpan < iSpans; ++iSpan)
- {
- pPoint = pPoints + iSpan;
- piWidth = piWidths + iSpan;
-
- hbmpWindow = winCreateDIBNativeGDI (*piWidth, 1,
- pDrawable->depth,
- &pbWindow,
- NULL);
-
- hbmpOrig = SelectObject (hdcMem, hbmpWindow);
-
- /* Transfer the window bits to the window bitmap */
- BitBlt (hdcMem,
- 0, 0,
- *piWidth, 1,
- pScreenPriv->hdcScreen,
- pPoint->x, pPoint->y,
- SRCCOPY);
-
- memcpy (pDst,
- (char*) pbWindow,
- PixmapBytePad (*piWidth, pDrawable->depth));
-
- /* Pop the window bitmap out of the HDC */
- SelectObject (hdcMem, hbmpOrig);
-
- DeleteObject (hbmpWindow);
-
- /* Calculate offset of next bit destination */
- pDst += PixmapBytePad (*piWidth, pDrawable->depth);
- }
-
- /* Delete the window bitmap */
- DeleteDC (hdcMem);
- break;
-
- case UNDRAWABLE_WINDOW:
- FatalError ("winGetSpans - UNDRAWABLE_WINDOW\n");
- break;
-
- case DRAWABLE_BUFFER:
- FatalError ("winGetSpans - DRAWABLE_BUFFER\n");
- break;
-
- default:
- FatalError ("winGetSpans - Unknown drawable type\n");
- break;
- }
-}
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *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 XFREE86 PROJECT 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 XFree86 Project
+ *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 XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ * Alan Hourihane <alanh@fairlite.demon.co.uk>
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+
+/* See Porting Layer Definition - p. 55 */
+void
+winGetSpansNativeGDI (DrawablePtr pDrawable,
+ int nMax,
+ DDXPointPtr pPoints,
+ int *piWidths,
+ int iSpans,
+ char *pDsts)
+{
+ PixmapPtr pPixmap = NULL;
+ winPrivPixmapPtr pPixmapPriv = NULL;
+ int iSpan;
+ DDXPointPtr pPoint = NULL;
+ int *piWidth = NULL;
+ char *pDst = pDsts;
+ HBITMAP hbmpWindow, hbmpOrig, hbmpOrig1;
+ BYTE *pbWindow = NULL;
+ HDC hdcMem, hdcMem1;
+ ScreenPtr pScreen = pDrawable->pScreen;
+ winScreenPriv(pScreen);
+
+ /* Branch on the drawable type */
+ switch (pDrawable->type)
+ {
+ case DRAWABLE_PIXMAP:
+ winDebug ("winGetSpans - DRAWABLE_PIXMAP %08x\n",
+ pDrawable);
+
+ pPixmap = (PixmapPtr) pDrawable;
+ pPixmapPriv = winGetPixmapPriv (pPixmap);
+
+ /* Open a memory HDC */
+ hdcMem1 = CreateCompatibleDC (NULL);
+ hdcMem = CreateCompatibleDC (NULL);
+
+ /* Select the drawable pixmap into a DC */
+ hbmpOrig1 = SelectObject (hdcMem1, pPixmapPriv->hBitmap);
+
+ if (hbmpOrig1 == NULL)
+ FatalError ("winGetSpans - DRAWABLE_PIXMAP - SelectObject () "
+ "failed on pPixmapPriv->hBitmap\n");
+
+ /* Loop through spans */
+ for (iSpan = 0; iSpan < iSpans; ++iSpan)
+ {
+ pPoint = pPoints + iSpan;
+ piWidth = piWidths + iSpan;
+
+ hbmpWindow = winCreateDIBNativeGDI (*piWidth, 1,
+ pDrawable->depth,
+ &pbWindow,
+ NULL);
+
+ hbmpOrig = SelectObject (hdcMem, hbmpWindow);
+
+ /* Transfer the window bits to the window bitmap */
+ BitBlt (hdcMem,
+ 0, 0,
+ *piWidth, 1,
+ hdcMem1,
+ pPoint->x, pPoint->y,
+ SRCCOPY);
+
+ memcpy (pDst,
+ (char*) pbWindow,
+ PixmapBytePad (*piWidth, pDrawable->depth));
+
+ /* Pop the window bitmap out of the HDC and delete the bitmap */
+ SelectObject (hdcMem, hbmpOrig);
+ DeleteObject (hbmpWindow);
+
+ /* Calculate offset of next bit destination */
+ pDst += PixmapBytePad (*piWidth, pDrawable->depth);
+ }
+
+ /* Pop the pixmap's bitmap out of the HDC */
+ SelectObject (hdcMem1, hbmpOrig1);
+
+ /* Delete the HDCs */
+ DeleteDC (hdcMem1);
+ DeleteDC (hdcMem);
+ break;
+
+ case DRAWABLE_WINDOW:
+
+ /* Open a memory HDC */
+ hdcMem = CreateCompatibleDC (NULL);
+
+ /* Loop through spans */
+ for (iSpan = 0; iSpan < iSpans; ++iSpan)
+ {
+ pPoint = pPoints + iSpan;
+ piWidth = piWidths + iSpan;
+
+ hbmpWindow = winCreateDIBNativeGDI (*piWidth, 1,
+ pDrawable->depth,
+ &pbWindow,
+ NULL);
+
+ hbmpOrig = SelectObject (hdcMem, hbmpWindow);
+
+ /* Transfer the window bits to the window bitmap */
+ BitBlt (hdcMem,
+ 0, 0,
+ *piWidth, 1,
+ pScreenPriv->hdcScreen,
+ pPoint->x, pPoint->y,
+ SRCCOPY);
+
+ memcpy (pDst,
+ (char*) pbWindow,
+ PixmapBytePad (*piWidth, pDrawable->depth));
+
+ /* Pop the window bitmap out of the HDC */
+ SelectObject (hdcMem, hbmpOrig);
+
+ DeleteObject (hbmpWindow);
+
+ /* Calculate offset of next bit destination */
+ pDst += PixmapBytePad (*piWidth, pDrawable->depth);
+ }
+
+ /* Delete the window bitmap */
+ DeleteDC (hdcMem);
+ break;
+
+ default:
+ FatalError ("winGetSpans - Unknown drawable type\n");
+ break;
+ }
+}
diff --git a/xorg-server/hw/xwin/winsetsp.c b/xorg-server/hw/xwin/winsetsp.c
index d1803489a..6150a9182 100644
--- a/xorg-server/hw/xwin/winsetsp.c
+++ b/xorg-server/hw/xwin/winsetsp.c
@@ -176,14 +176,6 @@ winSetSpansNativeGDI (DrawablePtr pDrawable,
SelectClipRgn (pGCPriv->hdc, NULL);
break;
- case UNDRAWABLE_WINDOW:
- FatalError ("\nwinSetSpansNativeGDI - UNDRAWABLE_WINDOW\n\n");
- break;
-
- case DRAWABLE_BUFFER:
- FatalError ("\nwinSetSpansNativeGDI - DRAWABLE_BUFFER\n\n");
- break;
-
default:
FatalError ("\nwinSetSpansNativeGDI - Unknown drawable type\n\n");
break;
diff --git a/xorg-server/include/callback.h b/xorg-server/include/callback.h
index 632ed4f32..2c4510a6e 100644
--- a/xorg-server/include/callback.h
+++ b/xorg-server/include/callback.h
@@ -1,87 +1,98 @@
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-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.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#ifndef CALLBACK_H
-#define CALLBACK_H
-
-#include <X11/X.h> /* for GContext, Mask */
-#include <X11/Xdefs.h> /* for Bool */
-#include <X11/Xproto.h>
-#include <X11/Xfuncproto.h>
-
-/*
- * callback manager stuff
- */
-
-#ifndef _XTYPEDEF_CALLBACKLISTPTR
-typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */
-#define _XTYPEDEF_CALLBACKLISTPTR
-#endif
-
-typedef void (*CallbackProcPtr) (
- CallbackListPtr *, pointer, pointer);
-
-extern _X_EXPORT Bool AddCallback(
- CallbackListPtr * /*pcbl*/,
- CallbackProcPtr /*callback*/,
- pointer /*data*/);
-
-extern _X_EXPORT Bool DeleteCallback(
- CallbackListPtr * /*pcbl*/,
- CallbackProcPtr /*callback*/,
- pointer /*data*/);
-
-extern _X_EXPORT void CallCallbacks(
- CallbackListPtr * /*pcbl*/,
- pointer /*call_data*/);
-
-extern _X_EXPORT void DeleteCallbackList(
- CallbackListPtr * /*pcbl*/);
-
-extern _X_EXPORT void InitCallbackManager(void);
-
-#endif /* CALLBACK_H */
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#ifndef CALLBACK_H
+#define CALLBACK_H
+
+#include <X11/X.h> /* for GContext, Mask */
+#include <X11/Xdefs.h> /* for Bool */
+#include <X11/Xproto.h>
+#include <X11/Xfuncproto.h>
+
+#ifdef _MSC_VER
+#define inline __inline
+#endif
+
+/*
+ * callback manager stuff
+ */
+
+#ifndef _XTYPEDEF_CALLBACKLISTPTR
+typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */
+#define _XTYPEDEF_CALLBACKLISTPTR
+#endif
+
+typedef void (*CallbackProcPtr) (
+ CallbackListPtr *, pointer, pointer);
+
+extern _X_EXPORT Bool AddCallback(
+ CallbackListPtr * /*pcbl*/,
+ CallbackProcPtr /*callback*/,
+ pointer /*data*/);
+
+extern _X_EXPORT Bool DeleteCallback(
+ CallbackListPtr * /*pcbl*/,
+ CallbackProcPtr /*callback*/,
+ pointer /*data*/);
+
+extern _X_EXPORT void _CallCallbacks(
+ CallbackListPtr * /*pcbl*/,
+ pointer /*call_data*/);
+
+static inline void
+CallCallbacks(CallbackListPtr *pcbl, pointer call_data)
+{
+ if (!pcbl || !*pcbl) return;
+ _CallCallbacks(pcbl, call_data);
+}
+
+extern _X_EXPORT void DeleteCallbackList(
+ CallbackListPtr * /*pcbl*/);
+
+extern _X_EXPORT void InitCallbackManager(void);
+
+#endif /* CALLBACK_H */
diff --git a/xorg-server/include/dix.h b/xorg-server/include/dix.h
index e5a0d5c51..ac19a9536 100644
--- a/xorg-server/include/dix.h
+++ b/xorg-server/include/dix.h
@@ -401,7 +401,7 @@ extern _X_EXPORT void WindowHasNewCursor(
extern Bool CheckDeviceGrabs(
DeviceIntPtr /* device */,
DeviceEvent* /* event */,
- int /* checkFirst */);
+ WindowPtr /* ancestor */);
extern void DeliverFocusedEvent(
DeviceIntPtr /* keybd */,
diff --git a/xorg-server/include/pixmap.h b/xorg-server/include/pixmap.h
index 9761ce48c..dc76a5b54 100644
--- a/xorg-server/include/pixmap.h
+++ b/xorg-server/include/pixmap.h
@@ -55,16 +55,14 @@ SOFTWARE.
#define DRAWABLE_WINDOW 0
#define DRAWABLE_PIXMAP 1
#define UNDRAWABLE_WINDOW 2
-#define DRAWABLE_BUFFER 3
/* corresponding type masks for dixLookupDrawable() */
#define M_DRAWABLE_WINDOW (1<<0)
#define M_DRAWABLE_PIXMAP (1<<1)
#define M_UNDRAWABLE_WINDOW (1<<2)
-#define M_DRAWABLE_BUFFER (1<<3)
#define M_ANY (-1)
#define M_WINDOW (M_DRAWABLE_WINDOW|M_UNDRAWABLE_WINDOW)
-#define M_DRAWABLE (M_DRAWABLE_WINDOW|M_DRAWABLE_PIXMAP|M_DRAWABLE_BUFFER)
+#define M_DRAWABLE (M_DRAWABLE_WINDOW|M_DRAWABLE_PIXMAP)
#define M_UNDRAWABLE (M_UNDRAWABLE_WINDOW)
/* flags to PaintWindow() */
@@ -88,7 +86,7 @@ typedef union _PixUnion {
((as) == (bs) && (SamePixUnion (a, b, as)))
#define OnScreenDrawable(type) \
- ((type == DRAWABLE_WINDOW) || (type == DRAWABLE_BUFFER))
+ (type == DRAWABLE_WINDOW)
#define WindowDrawable(type) \
((type == DRAWABLE_WINDOW) || (type == UNDRAWABLE_WINDOW))
diff --git a/xorg-server/test/Makefile.am b/xorg-server/test/Makefile.am
index 7c4467161..8bb3a0688 100644
--- a/xorg-server/test/Makefile.am
+++ b/xorg-server/test/Makefile.am
@@ -1,42 +1,41 @@
-if UNITTESTS
-SUBDIRS= . xi2
-check_PROGRAMS = xkb input xtest
-check_LTLIBRARIES = libxservertest.la
-
-TESTS=$(check_PROGRAMS)
-
-AM_CFLAGS = $(DIX_CFLAGS) $(GLIB_CFLAGS) @XORG_CFLAGS@
-INCLUDES = @XORG_INCS@
-TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS)
-
-if SPECIAL_DTRACE_OBJECTS
-TEST_LDADD += $(OS_LIB) $(DIX_LIB)
-endif
-
-xkb_LDADD=$(TEST_LDADD)
-input_LDADD=$(TEST_LDADD)
-xtest_LDADD=$(TEST_LDADD)
-
-libxservertest_la_LIBADD = \
- $(XSERVER_LIBS) \
- $(top_builddir)/hw/xfree86/loader/libloader.la \
- $(top_builddir)/hw/xfree86/os-support/libxorgos.la \
- $(top_builddir)/hw/xfree86/common/libcommon.la \
- $(top_builddir)/hw/xfree86/parser/libxf86config_internal.la \
- $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \
- $(top_builddir)/hw/xfree86/modes/libxf86modes.la \
- $(top_builddir)/hw/xfree86/ramdac/libramdac.la \
- $(top_builddir)/hw/xfree86/ddc/libddc.la \
- $(top_builddir)/hw/xfree86/i2c/libi2c.la \
- $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
- $(top_builddir)/hw/xfree86/libxorg.la \
- $(top_builddir)/mi/libmi.la \
- $(top_builddir)/os/libos.la \
- @XORG_LIBS@
-
-CLEANFILES=libxservertest.c
-
-libxservertest.c:
- touch $@
-
-endif
+if UNITTESTS
+SUBDIRS= . xi2
+check_PROGRAMS = xkb input xtest
+check_LTLIBRARIES = libxservertest.la
+
+TESTS=$(check_PROGRAMS)
+
+AM_CFLAGS = $(DIX_CFLAGS) $(GLIB_CFLAGS) @XORG_CFLAGS@
+INCLUDES = @XORG_INCS@
+TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS)
+
+if SPECIAL_DTRACE_OBJECTS
+TEST_LDADD += $(OS_LIB) $(DIX_LIB)
+endif
+
+xkb_LDADD=$(TEST_LDADD)
+input_LDADD=$(TEST_LDADD)
+xtest_LDADD=$(TEST_LDADD)
+
+libxservertest_la_LIBADD = \
+ $(XSERVER_LIBS) \
+ $(top_builddir)/hw/xfree86/loader/libloader.la \
+ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \
+ $(top_builddir)/hw/xfree86/common/libcommon.la \
+ $(top_builddir)/hw/xfree86/parser/libxf86config_internal.la \
+ $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \
+ $(top_builddir)/hw/xfree86/modes/libxf86modes.la \
+ $(top_builddir)/hw/xfree86/ramdac/libramdac.la \
+ $(top_builddir)/hw/xfree86/ddc/libddc.la \
+ $(top_builddir)/hw/xfree86/i2c/libi2c.la \
+ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
+ $(top_builddir)/hw/xfree86/libxorg.la \
+ $(top_builddir)/mi/libmi.la \
+ $(top_builddir)/os/libos.la \
+ @XORG_LIBS@
+endif
+
+CLEANFILES=libxservertest.c
+
+libxservertest.c:
+ touch $@