aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-05-18 15:08:29 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-08-27 14:10:16 +0200
commit6dcdc578f450c71933d7f7c40383358f73e45358 (patch)
tree3db77923f43b4689384cf590cbec4d2ffb02bcf0
parentebfd8742cb043f718704622b0b8495affe98a708 (diff)
downloadnx-libs-6dcdc578f450c71933d7f7c40383358f73e45358.tar.gz
nx-libs-6dcdc578f450c71933d7f7c40383358f73e45358.tar.bz2
nx-libs-6dcdc578f450c71933d7f7c40383358f73e45358.zip
Events.c: improve debugging output for FocusIn/Out
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c60
1 files changed, 56 insertions, 4 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index 8bc06e0ae..c9f5324a0 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -292,6 +292,36 @@ void ProcessInputEvents(void)
mieqProcessInputEvents();
}
+#ifdef DEBUG
+char * nxagentGetNotifyMode(int mode)
+{
+ switch (mode)
+ {
+ case NotifyNormal:
+ {
+ return "NotifyNormal";
+ break;
+ }
+ case NotifyGrab:
+ {
+ return "NotifyGrab";
+ break;
+ }
+ case NotifyUngrab:
+ {
+ return "NotifyUngrab";
+ break;
+ }
+ case NotifyWhileGrabbed:
+ {
+ return "NotifyWhileGrabbed";
+ break;
+ }
+ }
+ return "Unknown";
+}
+#endif
+
#ifdef DEBUG_TREE
/*
@@ -1530,8 +1560,18 @@ FIXME: Don't enqueue the KeyRelease event if the key was
{
WindowPtr pWin;
- #ifdef TEST
- fprintf(stderr, "nxagentDispatchEvents: Going to handle new FocusIn event.\n");
+ #ifdef DEBUG
+ fprintf(stderr, "%s: Going to handle new FocusIn event [0x%x] mode: [%s]\n", __func__, X.xfocus.window, nxagentGetNotifyMode(X.xfocus.mode));
+ {
+ XlibWindow w;
+ int revert_to;
+ XGetInputFocus(nxagentDisplay, &w, &revert_to);
+ fprintf(stderr, "%s: (FocusIn): Event win [0x%x] Focus owner [0x%x] nxagentDefaultWindows[0] [0x%x]\n", __func__, X.xfocus.window, w, nxagentDefaultWindows[0]);
+ }
+ #else
+ #ifdef TEST
+ fprintf(stderr, "%s: Going to handle new FocusIn event\n", __func__);
+ #endif
#endif
/*
@@ -1567,13 +1607,25 @@ FIXME: Don't enqueue the KeyRelease event if the key was
#endif
nxagentGrabPointerAndKeyboard(NULL);
}
+ /* else
+ {
+ #ifdef DEBUG
+ fprintf(stderr, "%s: (FocusIn): ungrabbing\n", __func__);
+ #endif
+ nxagentUngrabPointerAndKeyboard(NULL);
+ }
+ */
}
break;
}
case FocusOut:
{
- #ifdef TEST
- fprintf(stderr, "nxagentDispatchEvents: Going to handle new FocusOut event.\n");
+ #ifdef DEBUG
+ fprintf(stderr, "%s: Going to handle new FocusOut event [0x%x] mode: [%s]\n", __func__, X.xfocus.window, nxagentGetNotifyMode(X.xfocus.mode));
+ #else
+ #ifdef TEST
+ fprintf(stderr, "%s: Going to handle new FocusOut event.\n", __func__);
+ #endif
#endif
if (X.xfocus.detail != NotifyInferior)