aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-12-17 21:49:57 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-01-06 00:50:30 +0100
commit11d9b74b61492503e6a39346b8d171d4cf18b811 (patch)
treeeff487131bc16dd8d2bdf31bdc6c0b9d926edb30
parentd409b566bdaf7d40f1697095e62b7811c793fd30 (diff)
downloadnx-libs-11d9b74b61492503e6a39346b8d171d4cf18b811.tar.gz
nx-libs-11d9b74b61492503e6a39346b8d171d4cf18b811.tar.bz2
nx-libs-11d9b74b61492503e6a39346b8d171d4cf18b811.zip
Events.c: improve debugging output
Extend nxagentHandleClientMessageEvent: better debug messages, suppress warning "Invalid window in ClientMessage" for legal case. I came across this while testing some clipboard stuff.
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index b9d3a9238..859a01bf4 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -2578,11 +2578,6 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
{
*result = doNothing;
- #ifdef TEST
- fprintf(stderr, "%s: ClientMessage event window [%ld] with type [%ld] format [%d].\n",
- __func__, X -> xclient.window, X -> xclient.message_type, X -> xclient.format);
- #endif
-
/*
* If window is 0, message_type is 0 and format is 32 then we assume
* event is coming from proxy.
@@ -2592,11 +2587,25 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
X -> xclient.message_type == 0 &&
X -> xclient.format == 32)
{
+ #ifdef TEST
+ fprintf(stderr, "%s: got nxproxy event\n", __func__);
+ #endif
nxagentHandleProxyEvent(X);
return 1;
}
+ #ifdef TEST
+ char * name = XGetAtomName(nxagentDisplay, X -> xclient.message_type);
+ fprintf(stderr, "nxagentHandleClientMessageEvent: ClientMessage event window [0x%lx] with "
+ "message_type [%ld][%s] format [%d] type [%d] source_indication [%ld][%s] timestamp [%ld] "
+ "curwin [0x%lx].\n", X -> xclient.window, X -> xclient.message_type, name,
+ X -> xclient.format, X -> xclient.type, X -> xclient.data.l[0],
+ X -> xclient.data.l[0] == 1 ? "'application'" : X -> xclient.data.l[0] == 1 ? "'pager'" : "'none (old spec)'",
+ X -> xclient.data.l[1], X -> xclient.data.l[2]);
+ SAFE_XFree(name);
+ #endif
+
if (nxagentOption(Rootless))
{
Atom message_type = nxagentRemoteToLocalAtom(X -> xclient.message_type);
@@ -2611,11 +2620,20 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
}
WindowPtr pWin = nxagentWindowPtr(X -> xclient.window);
-
if (pWin == NULL)
{
+ /*
+ * If some window on the real X server sends a
+ * _NET_ACTIVE_WINDOW ClientMessage to indicate the active
+ * window that window will be one not belonging to nxagent so
+ * this situation is perfectly legal. For all other situations
+ * we print a warning.
+ */
#ifdef WARNING
- fprintf(stderr, "WARNING: Invalid window in ClientMessage.\n");
+ if (message_type != MakeAtom("_NET_ACTIVE_WINDOW", strlen("_NET_ACTIVE_WINDOW"), False))
+ {
+ fprintf(stderr, "WARNING: Invalid window in ClientMessage xclient.window [0x%lx].\n", X->xclient.window);
+ }
#endif
return 0;