Commit b64e1f60 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

NXevents.c: call upstream version of ProcSendEvent()

parent a6603778
...@@ -3947,9 +3947,12 @@ CloseDownEvents(void) ...@@ -3947,9 +3947,12 @@ CloseDownEvents(void)
spriteTraceSize = 0; spriteTraceSize = 0;
} }
#ifndef NXAGENT_SERVER
int int
#ifdef NXAGENT_SERVER
xorg_ProcSendEvent(ClientPtr client)
#else
ProcSendEvent(ClientPtr client) ProcSendEvent(ClientPtr client)
#endif
{ {
WindowPtr pWin; WindowPtr pWin;
WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */ WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */
...@@ -4034,7 +4037,6 @@ ProcSendEvent(ClientPtr client) ...@@ -4034,7 +4037,6 @@ ProcSendEvent(ClientPtr client)
NullGrab, 0); NullGrab, 0);
return Success; return Success;
} }
#endif /* NXAGENT_SERVER */
int int
ProcUngrabKey(ClientPtr client) ProcUngrabKey(ClientPtr client)
......
...@@ -488,96 +488,17 @@ DefineInitialRootWindow(register WindowPtr win) ...@@ -488,96 +488,17 @@ DefineInitialRootWindow(register WindowPtr win)
int int
ProcSendEvent(ClientPtr client) ProcSendEvent(ClientPtr client)
{ {
WindowPtr pWin; #ifdef NXAGENT_CLIPBOARD
WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */
REQUEST(xSendEventReq); REQUEST(xSendEventReq);
REQUEST_SIZE_MATCH(xSendEventReq); REQUEST_SIZE_MATCH(xSendEventReq);
/* The client's event type must be a core event type or one defined by an
extension. */
#ifdef NXAGENT_CLIPBOARD
if (stuff -> event.u.u.type == SelectionNotify) if (stuff -> event.u.u.type == SelectionNotify)
{ {
if (nxagentSendNotify(&stuff->event) == 1) if (nxagentSendNotify(&stuff->event) == 1)
return Success; return Success;
} }
#endif #endif
return xorg_ProcSendEvent(client);
if ( ! ((stuff->event.u.u.type > X_Reply &&
stuff->event.u.u.type < LASTEvent) ||
(stuff->event.u.u.type >= EXTENSION_EVENT_BASE &&
stuff->event.u.u.type < (unsigned)lastEvent)))
{
client->errorValue = stuff->event.u.u.type;
return BadValue;
}
if (stuff->event.u.u.type == ClientMessage &&
stuff->event.u.u.detail != 8 &&
stuff->event.u.u.detail != 16 &&
stuff->event.u.u.detail != 32)
{
client->errorValue = stuff->event.u.u.detail;
return BadValue;
}
if (stuff->eventMask & ~AllEventMasks)
{
client->errorValue = stuff->eventMask;
return BadValue;
}
if (stuff->destination == PointerWindow)
pWin = sprite.win;
else if (stuff->destination == InputFocus)
{
WindowPtr inputFocus = inputInfo.keyboard->focus->win;
if (inputFocus == NoneWin)
return Success;
/* If the input focus is PointerRootWin, send the event to where
the pointer is if possible, then perhaps propagate up to root. */
if (inputFocus == PointerRootWin)
inputFocus = ROOT;
if (IsParent(inputFocus, sprite.win))
{
effectiveFocus = inputFocus;
pWin = sprite.win;
}
else
effectiveFocus = pWin = inputFocus;
}
else
pWin = SecurityLookupWindow(stuff->destination, client,
DixReadAccess);
if (!pWin)
return BadWindow;
if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue))
{
client->errorValue = stuff->propagate;
return BadValue;
}
stuff->event.u.u.type |= 0x80;
if (stuff->propagate)
{
for (;pWin; pWin = pWin->parent)
{
if (DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask,
NullGrab, 0))
return Success;
if (pWin == effectiveFocus)
return Success;
stuff->eventMask &= ~wDontPropagateMask(pWin);
if (!stuff->eventMask)
break;
}
}
else
(void)DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask,
NullGrab, 0);
return Success;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment