wayland: Set default title in toplevel_init()
authorBenjamin Otte <otte@redhat.com>
Fri, 21 Apr 2023 20:10:00 +0000 (22:10 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 26 Apr 2023 19:03:34 +0000 (21:03 +0200)
gdk/wayland/gdksurface-wayland.c
gdk/wayland/gdktoplevel-wayland.c

index e60a587ca7c541357d4d4621d5067b89091dcf9a..816d47243ec8c45a830b15cc3ffa9c0b35371e7b 100644 (file)
@@ -107,20 +107,6 @@ fill_presentation_time_from_frame_time (GdkFrameTimings *timings,
     }
 }
 
-static const char *
-get_default_title (void)
-{
-  const char *title;
-
-  title = g_get_application_name ();
-  if (!title)
-    title = g_get_prgname ();
-  if (!title)
-    title = "";
-
-  return title;
-}
-
 static gboolean
 is_realized_shell_surface (GdkWaylandSurface *impl)
 {
@@ -868,7 +854,6 @@ gdk_wayland_display_create_surface (GdkDisplay     *display,
       g_warn_if_fail (parent == NULL);
       surface = g_object_new (GDK_TYPE_WAYLAND_TOPLEVEL,
                               "display", display,
-                              "title", get_default_title (),
                               NULL);
       break;
     case GDK_SURFACE_POPUP:
index de78d2a51a9260c089c7616bcb91f6726395afdf..022e341dd721e0acdf33433c8aea8d858b778e29 100644 (file)
@@ -823,6 +823,20 @@ gdk_wayland_surface_create_xdg_toplevel (GdkWaylandToplevel *wayland_toplevel)
   wl_surface_commit (wayland_surface->display_server.wl_surface);
 }
 
+static const char *
+get_default_title (void)
+{
+  const char *title;
+
+  title = g_get_application_name ();
+  if (!title)
+    title = g_get_prgname ();
+  if (!title)
+    title = "";
+
+  return title;
+}
+
 static void
 gdk_wayland_toplevel_init (GdkWaylandToplevel *toplevel)
 {
@@ -830,6 +844,8 @@ gdk_wayland_toplevel_init (GdkWaylandToplevel *toplevel)
   toplevel->shortcuts_inhibitors = g_hash_table_new (NULL, NULL);
   toplevel->saved_width = -1;
   toplevel->saved_height = -1;
+
+  toplevel->title = g_strdup (get_default_title ());
 }
 
 static void