node-editor: Print default renderer in title
authorBenjamin Otte <otte@redhat.com>
Fri, 12 May 2023 15:16:22 +0000 (17:16 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 5 Jun 2023 11:52:43 +0000 (07:52 -0400)
If there is a value passed to GSK_RENDERER, display it in the window
title.

This is mostly so that when I show off screenshots, people know what
renderer I'm using.

demos/node-editor/node-editor-window.c

index 9eb5fcfac60833ea4a92ecceccc15f21670947d1..4be1adadd25de6ba780ee1bfd3688afb17cc4968 100644 (file)
@@ -1309,6 +1309,13 @@ node_editor_window_init (NodeEditorWindow *self)
          "  }\n"
          "  transform: translate(0, 140);\n"
          "}", -1);
+
+  if (g_getenv ("GSK_RENDERER"))
+    {
+      char *new_title = g_strdup_printf ("GTK Node Editor - %s", g_getenv ("GSK_RENDERER"));
+      gtk_window_set_title (GTK_WINDOW (self), new_title);
+      g_free (new_title);
+    }
 }
 
 NodeEditorWindow *