[gtk/wip/readonly-events: 14/22] wip focus spew



commit 28341552503642b27c16d4bad411e5c29f264548
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Feb 13 12:27:43 2020 -0500

    wip focus spew

 gtk/gtkmain.c   | 2 ++
 gtk/gtkwindow.c | 4 ++++
 2 files changed, 6 insertions(+)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 8fb03f784a..08fd1b407c 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1323,6 +1323,8 @@ synth_crossing (GtkWidget       *widget,
       event->focus_change.mode = crossing_mode;
       event->focus_change.detail = notify_type;
 
+g_print ("%s: %s\n", G_OBJECT_TYPE_NAME (widget), enter ? "focus-in" : "focus-out");
+
       flags = GTK_STATE_FLAG_FOCUSED;
       if (!GTK_IS_WINDOW (toplevel) || gtk_window_get_focus_visible (GTK_WINDOW (toplevel)))
         flags |= GTK_STATE_FLAG_FOCUS_VISIBLE;
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 701cfb6f33..efcfa998cb 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6467,6 +6467,10 @@ gtk_window_set_focus (GtkWindow *window,
   if (event->any.surface)
     g_object_ref (event->any.surface);
 
+g_print ("window: focus %s -> %s\n",
+         old_focus ? G_OBJECT_TYPE_NAME (old_focus) : "",
+         focus ? G_OBJECT_TYPE_NAME (focus) : "");
+ 
   gtk_synthesize_crossing_events (GTK_ROOT (window), old_focus, focus, event, GDK_CROSSING_NORMAL);
 
   g_object_unref (event);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]