From d621ea397a3d181e7a0bf07d72bd21e116fccdb8 Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 14 Oct 2010 09:46:33 +0000 Subject: xserver git update 14/10/2010 --- xorg-server/dix/devices.c | 2 +- xorg-server/dix/dispatch.c | 13 ++------ xorg-server/dix/dixutils.c | 9 +----- xorg-server/dix/enterleave.c | 13 +++----- xorg-server/dix/events.c | 76 +++++++++++++++++++------------------------- 5 files changed, 41 insertions(+), 72 deletions(-) (limited to 'xorg-server/dix') diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c index 860a61867..f10f7a08d 100644 --- a/xorg-server/dix/devices.c +++ b/xorg-server/dix/devices.c @@ -2430,7 +2430,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 b651cb28b..b321e995b 100644 --- a/xorg-server/dix/dispatch.c +++ b/xorg-server/dix/dispatch.c @@ -916,23 +916,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) @@ -870,13 +870,6 @@ DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) return _DeleteCallback(pcbl, callback, data); } -void -CallCallbacks(CallbackListPtr *pcbl, pointer call_data) -{ - if (!pcbl || !*pcbl) return; - _CallCallbacks(pcbl, call_data); -} - void DeleteCallbackList(CallbackListPtr *pcbl) { 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 c9a73dc90..d1d6f910a 100644 --- a/xorg-server/dix/events.c +++ b/xorg-server/dix/events.c @@ -1276,7 +1276,6 @@ static void ComputeFreezes(void) { DeviceIntPtr replayDev = syncEvents.replayDev; - int i; WindowPtr w; GrabPtr grab; DeviceIntPtr dev; @@ -1294,29 +1293,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) @@ -2648,11 +2633,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); @@ -2688,11 +2673,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); @@ -3403,9 +3388,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 @@ -3614,7 +3596,7 @@ CheckPassiveGrabsOnWindow( */ Bool -CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, int checkFirst) +CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, WindowPtr ancestor) { int i; WindowPtr pWin = NULL; @@ -3629,30 +3611,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; } @@ -5065,7 +5055,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)) { -- cgit v1.2.3