From 03d7ce328711d0bc255ef26cb4e9ec24a2155c12 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 21 Apr 2023 22:10:00 +0200 Subject: [PATCH] wayland: Set default title in toplevel_init() --- gdk/wayland/gdksurface-wayland.c | 15 --------------- gdk/wayland/gdktoplevel-wayland.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index e60a587ca7..816d47243e 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -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: diff --git a/gdk/wayland/gdktoplevel-wayland.c b/gdk/wayland/gdktoplevel-wayland.c index de78d2a51a..022e341dd7 100644 --- a/gdk/wayland/gdktoplevel-wayland.c +++ b/gdk/wayland/gdktoplevel-wayland.c @@ -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