aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix')
-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
5 files changed, 41 insertions, 72 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))
{