Skip to content

Commit

Permalink
Merge branch 'uli42-pr/fix_qt_clientevents' into 3.6.x
Browse files Browse the repository at this point in the history
Attributes GH PR #1078: #1078
  • Loading branch information
sunweaver committed Nov 23, 2024
2 parents b6fae31 + 6e08d43 commit 58d42b6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions nx-X11/programs/Xserver/hw/nxagent/Events.c
Original file line number Diff line number Diff line change
Expand Up @@ -4505,14 +4505,14 @@ 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);
WindowPtr pWin = (WindowPtr)SecurityLookupWindow(stuff->destination, client,
DixReadAccess);

if (stuff->event.u.clientMessage.u.l.type == netwmstate || stuff->event.u.clientMessage.u.l.type == wmchangestate)
if (pWin && (stuff->event.u.clientMessage.u.l.type == netwmstate || stuff->event.u.clientMessage.u.l.type == wmchangestate))
{
if (pWin->drawable.id == pWin->drawable.pScreen->root->drawable.id)
{
Expand Down Expand Up @@ -4548,7 +4548,7 @@ 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);
Expand All @@ -4568,8 +4568,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 @@ -429,8 +429,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

0 comments on commit 58d42b6

Please sign in to comment.