From: Benjamin Otte Date: Fri, 21 Apr 2023 20:10:00 +0000 (+0200) Subject: wayland: Set default title in toplevel_init() X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~368^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=03d7ce328711d0bc255ef26cb4e9ec24a2155c12;p=gtk4.git wayland: Set default title in toplevel_init() --- 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