aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_utils.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-07-05 11:53:19 +0200
committerDavid Robillard <d@drobilla.net>2020-07-05 16:22:16 +0200
commit294c0f7d89b206612634978e3df166ce532a1118 (patch)
tree35e37daf6cb29281ce1f24ff6b06b08e4700be70 /test/test_utils.h
parenteac255d8dac99bc25140c8c0a81cad5926ebdefd (diff)
downloadpugl-294c0f7d89b206612634978e3df166ce532a1118.tar.gz
pugl-294c0f7d89b206612634978e3df166ce532a1118.tar.bz2
pugl-294c0f7d89b206612634978e3df166ce532a1118.zip
Replace grab flag in PuglEventFocus with crossing mode
Diffstat (limited to 'test/test_utils.h')
-rw-r--r--test/test_utils.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/test/test_utils.h b/test/test_utils.h
index 3cbed63..232537e 100644
--- a/test/test_utils.h
+++ b/test/test_utils.h
@@ -67,6 +67,21 @@ printModifiers(const uint32_t mods)
(mods & PUGL_MOD_SUPER) ? " Super" : "");
}
+static inline const char*
+crossingModeString(const PuglCrossingMode mode)
+{
+ switch (mode) {
+ case PUGL_CROSSING_NORMAL:
+ return "normal";
+ case PUGL_CROSSING_GRAB:
+ return "grab";
+ case PUGL_CROSSING_UNGRAB:
+ return "ungrab";
+ }
+
+ return "unknown";
+}
+
static inline int
printEvent(const PuglEvent* event, const char* prefix, const bool verbose)
{
@@ -121,13 +136,13 @@ printEvent(const PuglEvent* event, const char* prefix, const bool verbose)
event->crossing.x,
event->crossing.y);
case PUGL_FOCUS_IN:
- return PRINT("%sFocus in%s\n",
+ return PRINT("%sFocus in (%s)\n",
prefix,
- event->focus.grab ? " (grab)" : "");
+ crossingModeString(event->crossing.mode));
case PUGL_FOCUS_OUT:
- return PRINT("%sFocus out%s\n",
+ return PRINT("%sFocus out (%s)\n",
prefix,
- event->focus.grab ? " (ungrab)" : "");
+ crossingModeString(event->crossing.mode));
case PUGL_CLIENT:
return PRINT("%sClient %" PRIXPTR " %" PRIXPTR "\n",
prefix,