summaryrefslogtreecommitdiff
path: root/mcwm.c
diff options
context:
space:
mode:
authorMC <mc@hack.org>2010-06-24 17:28:16 +0200
committerMC <mc@hack.org>2010-06-24 17:28:16 +0200
commitd6ed181eee6f2dd3439e0e6057c868c2d5d4a8d0 (patch)
treeccb10065d6a039f3371139906a518ca6f44e6903 /mcwm.c
parent9b89fb40a58caed77c53732eb440db936592a837 (diff)
downloadmcwm-d6ed181eee6f2dd3439e0e6057c868c2d5d4a8d0.zip
Added debug printouts for incoming events.
Diffstat (limited to 'mcwm.c')
-rw-r--r--mcwm.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/mcwm.c b/mcwm.c
index 9221adf..ca0ca78 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -40,6 +40,10 @@
#include <X11/keysym.h>
+#ifdef DEBUG
+#include "events.h"
+#endif
+
/* Check here for user configurable parts: */
#include "config.h"
@@ -1124,8 +1128,17 @@ void events(void)
fprintf(stderr, "mcwm: Couldn't get event. Exiting...\n");
exit(1);
}
-
- PDEBUG("Event: %d\n", ev->response_type);
+
+#ifdef DEBUG
+ if (ev->response_type <= MAXEVENTS)
+ {
+ PDEBUG("Event: %s\n", evnames[ev->response_type]);
+ }
+ else
+ {
+ PDEBUG("Event: #%d. Not known.\n", ev->response_type);
+ }
+#endif
switch (ev->response_type & ~0x80)
{
@@ -1344,7 +1357,6 @@ void events(void)
if (e->mode == XCB_NOTIFY_MODE_NORMAL
|| e->mode == XCB_NOTIFY_MODE_UNGRAB)
{
-
/*
* If we're entering the same window we focus now,
* then don't bother focusing.