[gtk/wip/baedert/icontheme: 813/821] main: Check if any debug flags are set in gtk_get_debug_flags()



commit 3eab16932775c0a23f5feb120c65cc7286efcf0d
Author: Timm Bäder <mail baedert org>
Date:   Sat May 25 17:38:26 2019 +0200

    main: Check if any debug flags are set in gtk_get_debug_flags()
    
    We end up checking the debug flags for the default display, but that's
    unnecessary if we know that no display has any debug flags set anyway.

 gtk/gtkmain.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index e3e592595d..2d1ab71af5 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -740,7 +740,10 @@ gtk_set_display_debug_flags (GdkDisplay *display,
 guint
 gtk_get_debug_flags (void)
 {
-  return gtk_get_display_debug_flags (gdk_display_get_default ());
+  if (gtk_get_any_display_debug_flag_set ())
+    return gtk_get_display_debug_flags (gdk_display_get_default ());
+
+  return 0;
 }
 
 /**


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