diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-01-18 19:41:25 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-01-18 19:41:25 +0000 |
commit | aec4dc93874786c800a3b8dcb40785b53854dea3 (patch) | |
tree | a1a3f72ebedd2167995caf1bb4a35b6be7db0d26 | |
parent | 395b30dcfea4c97db7263ebaebc87ad326fff3cb (diff) | |
parent | 0a9e2d6ed77b3a8bebdb02b3e4805ffee50428b1 (diff) | |
download | gtk+-aec4dc93874786c800a3b8dcb40785b53854dea3.tar.gz |
Merge branch 'gtk_dbg_interactive_gtk3_backport' into 'gtk-3-24'
Allow GTK_DEBUG=interactive even without G_ENABLE_DEBUG defined
See merge request GNOME/gtk!3090
-rw-r--r-- | docs/reference/gtk/running.sgml | 6 | ||||
-rw-r--r-- | gtk/gtkmain.c | 11 |
2 files changed, 9 insertions, 8 deletions
diff --git a/docs/reference/gtk/running.sgml b/docs/reference/gtk/running.sgml index 520a12d42d..5b136c29b4 100644 --- a/docs/reference/gtk/running.sgml +++ b/docs/reference/gtk/running.sgml @@ -134,9 +134,9 @@ additional environment variables. <title><envar>GTK_DEBUG</envar></title> <para> - Unless GTK+ has been configured with <option>--enable-debug=no</option>, - this variable can be set to a list of debug options, which cause GTK+ - to print out different types of debugging information. + This variable can be set to a list of debug options, which cause GTK to + print out different types of debugging information. Some of these options + are only available when GTK has been configured with <option>--enable-debug=yes</option>. <variablelist> <varlistentry> <term>actions</term> diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index f7cbb342e2..ae64e1881c 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -167,7 +167,6 @@ typedef struct { DisplayDebugFlags debug_flags[N_DEBUG_DISPLAYS]; -#ifdef G_ENABLE_DEBUG static const GDebugKey gtk_debug_keys[] = { { "misc", GTK_DEBUG_MISC }, { "plugsocket", GTK_DEBUG_PLUGSOCKET }, @@ -192,7 +191,6 @@ static const GDebugKey gtk_debug_keys[] = { { "resize", GTK_DEBUG_RESIZE }, { "layout", GTK_DEBUG_LAYOUT } }; -#endif /* G_ENABLE_DEBUG */ /** * gtk_get_major_version: @@ -660,12 +658,15 @@ do_pre_parse_initialization (int *argc, env_string = g_getenv ("GTK_DEBUG"); if (env_string != NULL) { -#ifdef G_ENABLE_DEBUG debug_flags[0].flags = g_parse_debug_string (env_string, gtk_debug_keys, G_N_ELEMENTS (gtk_debug_keys)); -#else - g_warning ("GTK_DEBUG set but ignored because gtk isn't built with G_ENABLE_DEBUG"); +#ifndef G_ENABLE_DEBUG + /* No need to print the warning for "interactive" since it's kept anyway. */ + if (debug_flags[0].flags != GTK_DEBUG_INTERACTIVE) + g_warning ("GTK_DEBUG set but ignored because gtk isn't built with G_ENABLE_DEBUG"); + /* Only keep "interactive" if not with G_ENABLE_DEBUG. */ + debug_flags[0].flags &= GTK_DEBUG_INTERACTIVE; #endif /* G_ENABLE_DEBUG */ env_string = NULL; } |