mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 21:51:08 +00:00
wayland: Set default title in toplevel_init()
This commit is contained in:
parent
f2083d36a1
commit
03d7ce3287
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user