main: Add debug flag to show GTK inspector

Since squeekboard doesn't ever get input focus and hence we can't
activate it via keybinding add a debug flag.
This commit is contained in:
Guido Günther
2021-11-23 09:17:33 +01:00
parent 1c875cda6c
commit 03aa04d6d8

View File

@ -41,6 +41,7 @@
typedef enum _SqueekboardDebugFlags { typedef enum _SqueekboardDebugFlags {
SQUEEKBOARD_DEBUG_FLAG_NONE = 0, SQUEEKBOARD_DEBUG_FLAG_NONE = 0,
SQUEEKBOARD_DEBUG_FLAG_FORCE_SHOW = 1 << 0, SQUEEKBOARD_DEBUG_FLAG_FORCE_SHOW = 1 << 0,
SQUEEKBOARD_DEBUG_FLAG_GTK_INSPECTOR = 1 << 1,
} SqueekboardDebugFlags; } SqueekboardDebugFlags;
@ -285,6 +286,9 @@ static GDebugKey debug_keys[] =
{ .key = "force-show", { .key = "force-show",
.value = SQUEEKBOARD_DEBUG_FLAG_FORCE_SHOW, .value = SQUEEKBOARD_DEBUG_FLAG_FORCE_SHOW,
}, },
{ .key = "gtk-inspector",
.value = SQUEEKBOARD_DEBUG_FLAG_GTK_INSPECTOR,
},
}; };
@ -440,6 +444,9 @@ main (int argc, char **argv)
if (debug_flags & SQUEEKBOARD_DEBUG_FLAG_FORCE_SHOW) { if (debug_flags & SQUEEKBOARD_DEBUG_FLAG_FORCE_SHOW) {
server_context_service_force_show_keyboard (ui_context); server_context_service_force_show_keyboard (ui_context);
} }
if (debug_flags & SQUEEKBOARD_DEBUG_FLAG_GTK_INSPECTOR) {
gtk_window_set_interactive_debugging (TRUE);
}
loop = g_main_loop_new (NULL, FALSE); loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (loop); g_main_loop_run (loop);