summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-05-15 15:51:32 -0700
committerJamey Sharp <jamey@minilop.net>2010-05-19 12:32:34 -0700
commit90e612dcbe370da095d317fac62c80ac2447fa0b (patch)
tree2082dfe8f248626ea0decea4c89de47e1efe535d /dix
parent8033fb6c9792820a82fbdff6a14ff8a7a141ba74 (diff)
Use WriteEventsToClient rather than TryClientEvents where possible.
If filter is NoEventMask (aka CantBeFiltered), grab is null, and the first event is not in the set of "critical events", then TryClientEvents simply calls WriteEventsToClient. In that case, it returns 0 for fake or dead clients, and 1 otherwise. Inline for this special case. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'dix')
-rw-r--r--dix/selection.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/dix/selection.c b/dix/selection.c
index 4f592d123..f52638c3a 100644
--- a/dix/selection.c
+++ b/dix/selection.c
@@ -189,8 +189,7 @@ ProcSetSelectionOwner(ClientPtr client)
event.u.selectionClear.time = time.milliseconds;
event.u.selectionClear.window = pSel->window;
event.u.selectionClear.atom = pSel->selection;
- TryClientEvents(pSel->client, NULL, &event, 1, NoEventMask,
- NoEventMask /* CantBeFiltered */, NullGrab);
+ WriteEventsToClient(pSel->client, 1, &event);
}
}
else if (rc == BadMatch)
@@ -296,9 +295,11 @@ ProcConvertSelection(ClientPtr client)
event.u.selectionRequest.selection = stuff->selection;
event.u.selectionRequest.target = stuff->target;
event.u.selectionRequest.property = stuff->property;
- if (TryClientEvents(pSel->client, NULL, &event, 1, NoEventMask,
- NoEventMask /* CantBeFiltered */, NullGrab))
+ if (pSel->client && pSel->client != serverClient && !pSel->client->clientGone)
+ {
+ WriteEventsToClient(pSel->client, 1, &event);
return Success;
+ }
}
event.u.u.type = SelectionNotify;
@@ -307,7 +308,6 @@ ProcConvertSelection(ClientPtr client)
event.u.selectionNotify.selection = stuff->selection;
event.u.selectionNotify.target = stuff->target;
event.u.selectionNotify.property = None;
- TryClientEvents(client, NULL, &event, 1, NoEventMask,
- NoEventMask /* CantBeFiltered */, NullGrab);
+ WriteEventsToClient(client, 1, &event);
return Success;
}