kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16.git/commit/?id=53e15851c96ca3b0f58f7fd37923643641c1a72f

commit 53e15851c96ca3b0f58f7fd37923643641c1a72f
Author: Kim Woelders <[email protected]>
Date:   Fri Mar 12 21:15:00 2021 +0100

    Focus: Improve debug message understandability
---
 src/focus.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/focus.c b/src/focus.c
index 8fa87851..b15b9f41 100644
--- a/src/focus.c
+++ b/src/focus.c
@@ -41,6 +41,11 @@
 
 #define EwinListFocusRaise(ewin) EobjListFocusRaise(EoObj(ewin))
 
+static const char  *const focus_why[] = {
+   "NOP", "INIT", "SET", "NONE", "ENTER", "LEAVE", "EWIN_NEW", "EWIN_UNMAP",
+   "DESK_ENTER", "DESK_LEAVE", "NEXT", "PREV", "CLICK",
+};
+
 static char         focus_inhibit = 1;
 static char         focus_is_set = 0;
 static char         click_pending_update_grabs = 0;
@@ -354,9 +359,9 @@ doFocusToEwin(EWin * ewin, int why)
       return;
 
    if (EDebug(EDBUG_TYPE_FOCUS))
-      Eprintf("%s: %#x %s why=%d\n", __func__,
+      Eprintf("%s: %#x %s why=%s\n", __func__,
              (ewin) ? EwinGetClientXwin(ewin) : 0,
-             (ewin) ? EwinGetTitle(ewin) : "None", why);
+             (ewin) ? EwinGetTitle(ewin) : "None", focus_why[why]);
 
    switch (why)
      {
@@ -510,9 +515,9 @@ void
 FocusToEWin(EWin * ewin, int why)
 {
    if (EDebug(EDBUG_TYPE_FOCUS))
-      Eprintf("%s(%d) %#x %s why=%d\n", __func__, focus_inhibit,
+      Eprintf("%s(%d) %#x %s why=%s\n", __func__, focus_inhibit,
              (ewin) ? EwinGetClientXwin(ewin) : 0,
-             (ewin) ? EwinGetTitle(ewin) : "None", why);
+             (ewin) ? EwinGetTitle(ewin) : "None", focus_why[why]);
 
    switch (why)
      {

-- 


Reply via email to