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

Clipboard.c: introduce SendEventToClient helper

parent 2ee7626a
...@@ -401,6 +401,11 @@ Status SendSelectionNotifyEventToServer(XSelectionEvent *event_to_send) ...@@ -401,6 +401,11 @@ Status SendSelectionNotifyEventToServer(XSelectionEvent *event_to_send)
return result; return result;
} }
int SendEventToClient(ClientPtr client, xEvent *pEvents)
{
return TryClientEvents (client, pEvents, 1, NoEventMask, NoEventMask, NullGrab);
}
Bool nxagentValidServerTargets(Atom target) Bool nxagentValidServerTargets(Atom target)
{ {
if (target == XA_STRING) if (target == XA_STRING)
...@@ -516,9 +521,7 @@ void nxagentClearSelection(XEvent *X) ...@@ -516,9 +521,7 @@ void nxagentClearSelection(XEvent *X)
x.u.selectionClear.window = lastSelectionOwner[i].window; x.u.selectionClear.window = lastSelectionOwner[i].window;
x.u.selectionClear.atom = CurrentSelections[i].selection; x.u.selectionClear.atom = CurrentSelections[i].selection;
(void) TryClientEvents(lastSelectionOwner[i].client, &x, 1, SendEventToClient(lastSelectionOwner[i].client, &x);
NoEventMask, NoEventMask,
NullGrab);
} }
CurrentSelections[i].window = screenInfo.screens[0]->root->drawable.id; CurrentSelections[i].window = screenInfo.screens[0]->root->drawable.id;
...@@ -687,9 +690,7 @@ FIXME: Do we need this? ...@@ -687,9 +690,7 @@ FIXME: Do we need this?
x.u.selectionRequest.property = clientCutProperty; x.u.selectionRequest.property = clientCutProperty;
(void) TryClientEvents(lastSelectionOwner[i].client, &x, 1, SendEventToClient(lastSelectionOwner[i].client, &x);
NoEventMask, NoEventMask /* CantBeFiltered */,
NullGrab);
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: Executed TryClientEvents with clientCutProperty.\n", __func__); fprintf(stderr, "%s: Executed TryClientEvents with clientCutProperty.\n", __func__);
...@@ -742,8 +743,7 @@ void nxagentSendSelectionNotify(Atom property) ...@@ -742,8 +743,7 @@ void nxagentSendSelectionNotify(Atom property)
x.u.selectionNotify.property = property; x.u.selectionNotify.property = property;
TryClientEvents(lastClientClientPtr, &x, 1, NoEventMask, SendEventToClient(lastClientClientPtr, &x);
NoEventMask , NullGrab);
return; return;
} }
...@@ -1415,8 +1415,7 @@ FIXME: Why this pointer can be not a valid ...@@ -1415,8 +1415,7 @@ FIXME: Why this pointer can be not a valid
x.u.selectionNotify.target = target; x.u.selectionNotify.target = target;
x.u.selectionNotify.property = None; x.u.selectionNotify.property = None;
(void) TryClientEvents(client, &x, 1, NoEventMask, SendEventToClient(client, &x);
NoEventMask , NullGrab);
} }
int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
...@@ -1521,8 +1520,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, ...@@ -1521,8 +1520,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
x.u.selectionNotify.target = target; x.u.selectionNotify.target = target;
x.u.selectionNotify.property = property; x.u.selectionNotify.property = property;
(void) TryClientEvents(client, &x, 1, NoEventMask, SendEventToClient(client, &x);
NoEventMask , NullGrab);
return 1; return 1;
} }
...@@ -1554,8 +1552,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, ...@@ -1554,8 +1552,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
x.u.selectionNotify.target = target; x.u.selectionNotify.target = target;
x.u.selectionNotify.property = property; x.u.selectionNotify.property = property;
(void) TryClientEvents(client, &x, 1, NoEventMask, SendEventToClient(client, &x);
NoEventMask , NullGrab);
return 1; return 1;
...@@ -1642,7 +1639,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, ...@@ -1642,7 +1639,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
x.u.selectionNotify.selection = selection; x.u.selectionNotify.selection = selection;
x.u.selectionNotify.target = target; x.u.selectionNotify.target = target;
x.u.selectionNotify.property = None; x.u.selectionNotify.property = None;
(void) TryClientEvents(client, &x, 1, NoEventMask, NoEventMask , NullGrab); SendEventToClient(client, &x);
return 1; return 1;
} }
return 0; return 0;
......
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