[gtk+] Make GTK_DEBUG=interactive work better



commit 507a1e4d7a21387f2b245e93d3e2cc395a41fbd4
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jan 4 14:42:33 2017 -0500

    Make GTK_DEBUG=interactive work better
    
    We currently have various ways to initialize GTK+, and not
    all of them were supporting this way of bringing up the
    inspector. Fix this.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776807

 gtk/gtkmain.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index ab233dc..c9b91b2 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -785,6 +785,9 @@ post_parse_hook (GOptionContext *context,
 
           return FALSE;
         }
+
+      if (gtk_get_debug_flags () & GTK_DEBUG_INTERACTIVE)
+        gtk_window_set_interactive_debugging (TRUE);
     }
 
   return TRUE;
@@ -964,7 +967,15 @@ gtk_init_with_args (gint                 *argc,
     return FALSE;
 
 done:
-  return gdk_display_open_default () != NULL;
+  if (gdk_display_open_default () != NULL)
+    {
+      if (gtk_get_debug_flags () & GTK_DEBUG_INTERACTIVE)
+        gtk_window_set_interactive_debugging (TRUE);
+
+      return TRUE;
+    }
+
+  return FALSE;
 }
 
 


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