[gimp] app, menus: add new menu item Debug -> Start GtkInspector



commit 669127dbd6513fcbdd1ebc97d060e9853ede1cd3
Author: Michael Natterer <mitch gimp org>
Date:   Wed Jun 20 20:43:41 2018 +0200

    app, menus: add new menu item Debug -> Start GtkInspector
    
    so it can by launchaed at any time even if not requested via
    GTK_DEBUG=interactive and without enabling the magic keyboard
    shortcut.

 app/actions/debug-actions.c  | 5 +++++
 app/actions/debug-commands.c | 7 +++++++
 app/actions/debug-commands.h | 2 ++
 menus/image-menu.xml.in      | 2 ++
 4 files changed, 16 insertions(+)
---
diff --git a/app/actions/debug-actions.c b/app/actions/debug-actions.c
index c2fbff694b..6401e82249 100644
--- a/app/actions/debug-actions.c
+++ b/app/actions/debug-actions.c
@@ -36,6 +36,11 @@ static const GimpActionEntry debug_actions[] =
 {
   { "debug-menu", NULL, "_Debug" },
 
+  { "debug-gtk-inspector", NULL,
+    "Start _GtkInspector", NULL, NULL,
+    G_CALLBACK (debug_gtk_inspector_cmd_callback),
+    NULL },
+
   { "debug-mem-profile", NULL,
     "_Memory Profile", NULL, NULL,
     G_CALLBACK (debug_mem_profile_cmd_callback),
diff --git a/app/actions/debug-commands.c b/app/actions/debug-commands.c
index 8eb9f8d54a..dd8df164b8 100644
--- a/app/actions/debug-commands.c
+++ b/app/actions/debug-commands.c
@@ -70,6 +70,13 @@ static gboolean  debug_accel_find_func         (GtkAccelKey *key,
 
 /*  public functions  */
 
+void
+debug_gtk_inspector_cmd_callback (GtkAction *action,
+                                  gpointer   data)
+{
+  gtk_window_set_interactive_debugging (TRUE);
+}
+
 void
 debug_mem_profile_cmd_callback (GtkAction *action,
                                 gpointer   data)
diff --git a/app/actions/debug-commands.h b/app/actions/debug-commands.h
index 0504e20d08..94551b5432 100644
--- a/app/actions/debug-commands.h
+++ b/app/actions/debug-commands.h
@@ -19,6 +19,8 @@
 #define __DEBUG_COMMANDS_H__
 
 
+void   debug_gtk_inspector_cmd_callback           (GtkAction *action,
+                                                   gpointer   data);
 void   debug_mem_profile_cmd_callback             (GtkAction *action,
                                                    gpointer   data);
 void   debug_benchmark_projection_cmd_callback    (GtkAction *action,
diff --git a/menus/image-menu.xml.in b/menus/image-menu.xml.in
index 52067f0d04..eb302a4be1 100644
--- a/menus/image-menu.xml.in
+++ b/menus/image-menu.xml.in
@@ -25,6 +25,8 @@
 
 <!--  The debug-menu is hidden by default for stable releases  -->
       <menu action="debug-menu" name="Debug">
+        <menuitem action="debug-gtk-inspector" />
+        <separator />
         <menuitem action="debug-mem-profile" />
         <menuitem action="debug-benchmark-projection" />
         <menuitem action="debug-show-image-graph" />


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