Browse Source

LibGUI: Export GUI_FOCUS_DEBUG to visualize the focused widget

Using a command-line argument for this clashed with ArgsParser so let's
use an environment variable instead. I feel like Sergey told me to do
this at some point anyway. :^)
Andreas Kling 5 years ago
parent
commit
110b3d89d3
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Libraries/LibGUI/Application.cpp

+ 4 - 4
Libraries/LibGUI/Application.cpp

@@ -55,12 +55,12 @@ Application::Application(int argc, char** argv)
     Clipboard::initialize({});
     Clipboard::initialize({});
     if (argc > 0)
     if (argc > 0)
         m_invoked_as = argv[0];
         m_invoked_as = argv[0];
-    for (int i = 1; i < argc; i++) {
-        String arg(argv[i]);
 
 
-        if (arg == "--gui-focus-debug")
-            m_focus_debugging_enabled = true;
+    if (getenv("GUI_FOCUS_DEBUG"))
+        m_focus_debugging_enabled = true;
 
 
+    for (int i = 1; i < argc; i++) {
+        String arg(argv[i]);
         m_args.append(move(arg));
         m_args.append(move(arg));
     }
     }
 }
 }