[gnome-builder/wip/gtk4-port: 1268/1774] libide/foundry: use GTK_DEBUG=invert-text-dir




commit 2ff90bdeb7558cb85d54c45af0b0db150d5a437a
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jun 1 11:24:45 2022 -0700

    libide/foundry: use GTK_DEBUG=invert-text-dir
    
    For incoming MRs against GTK to add the feature.

 src/libide/foundry/ide-run-manager.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/libide/foundry/ide-run-manager.c b/src/libide/foundry/ide-run-manager.c
index 218e188a8..2cc8b6bdc 100644
--- a/src/libide/foundry/ide-run-manager.c
+++ b/src/libide/foundry/ide-run-manager.c
@@ -647,7 +647,9 @@ static void
 apply_text_direction (IdeEnvironment *env,
                       const char     *text_dir_str)
 {
+  g_autofree char *value = NULL;
   GtkTextDirection dir;
+  const char *gtk_debug;
 
   if (ide_str_equal0 (text_dir_str, "rtl"))
     dir = GTK_TEXT_DIR_RTL;
@@ -657,9 +659,14 @@ apply_text_direction (IdeEnvironment *env,
     g_return_if_reached ();
 
   if (dir == gtk_widget_get_default_direction ())
-    text_dir_str = NULL;
+    return;
+
+  if ((gtk_debug = ide_environment_getenv (env, "GTK_DEBUG")))
+    value = g_strdup_printf ("%s:invert-text-dir", gtk_debug);
+  else
+    value = g_strdup ("invert-text-dir");
 
-  ide_environment_setenv (env, "GTK_DEBUG_TEXT_DIR", text_dir_str);
+  ide_environment_setenv (env, "GTK_DEBUG", value);
 }
 
 static inline const char *


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