Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prematurely abort ProcSendEvent if a ClientMsg has been fordwarded #1078

Open
wants to merge 2 commits into
base: 3.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions nx-X11/programs/Xserver/hw/nxagent/Events.c
Original file line number Diff line number Diff line change
Expand Up @@ -4499,7 +4499,7 @@ int nxagentWaitEvents(Display *dpy, useconds_t msec)
return 1;
}

void ForwardClientMessage(ClientPtr client, xSendEventReq *stuff)
Bool ForwardClientMessage(ClientPtr client, xSendEventReq *stuff)
{
Atom netwmstate = MakeAtom("_NET_WM_STATE", strlen("_NET_WM_STATE"), False);
Atom wmchangestate = MakeAtom("WM_CHANGE_STATE", strlen("WM_CHANGE_STATE"), False);
Expand Down Expand Up @@ -4542,16 +4542,15 @@ void ForwardClientMessage(ClientPtr client, xSendEventReq *stuff)
#endif
}
else
return; // ERROR!
return False; // ERROR!

#ifdef DEBUG
fprintf(stderr, "%s: window [0x%lx]\n", __func__, X.xclient.window);
fprintf(stderr, "%s: message_type [%ld]\n", __func__, X.xclient.message_type);
fprintf(stderr, "%s: format [%d]\n", __func__, X.xclient.format);
#endif

XlibWindow dest;
dest = DefaultRootWindow(nxagentDisplay);
XlibWindow dest = DefaultRootWindow(nxagentDisplay);

#ifdef DEBUG
Status stat =
Expand All @@ -4562,8 +4561,10 @@ void ForwardClientMessage(ClientPtr client, xSendEventReq *stuff)
fprintf(stderr, "%s: send to window [0x%lx]\n", __func__, dest);
fprintf(stderr, "%s: return Status [%d]\n", __func__, stat);
#endif
return True;
}
}
return False;
}

#ifdef NX_DEBUG_INPUT
Expand Down
2 changes: 1 addition & 1 deletion nx-X11/programs/Xserver/hw/nxagent/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,6 @@ int nxagentPendingEvents(Display *dpy);

int nxagentWaitEvents(Display *, useconds_t msec);

void ForwardClientMessage(ClientPtr client, xSendEventReq *stuff);
Bool ForwardClientMessage(ClientPtr client, xSendEventReq *stuff);

#endif /* __Events_H__ */
4 changes: 2 additions & 2 deletions nx-X11/programs/Xserver/hw/nxagent/NXevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ ProcSendEvent(ClientPtr client)

if (nxagentOption(Rootless) && stuff->event.u.u.type == ClientMessage)
{
ForwardClientMessage(client, stuff);
return Success;
if (ForwardClientMessage(client, stuff))
return Success;
}

if (stuff -> event.u.u.type == SelectionNotify)
Expand Down
Loading