wayland: Allow set_title after initial showing

and fix the ordering of title / app_id
This commit is contained in:
Jasper St. Pierre 2013-11-21 12:03:18 -05:00
parent 750419e8d9
commit 9232089b35

View File

@ -860,6 +860,20 @@ gdk_wayland_window_sync_transient_for (GdkWindow *window)
xdg_surface_set_transient_for (impl->xdg_surface, transient_for_surface);
}
static void
gdk_wayland_window_sync_title (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
if (!impl->xdg_surface)
return;
if (!impl->title)
return;
xdg_surface_set_title (impl->xdg_surface, impl->title);
}
static void
surface_enter (void *data,
struct wl_surface *wl_surface,
@ -982,6 +996,9 @@ gdk_wayland_window_create_xdg_surface (GdkWindow *window)
impl->xdg_surface = xdg_shell_get_xdg_surface (display_wayland->xdg_shell, impl->surface);
xdg_surface_add_listener (impl->xdg_surface, &xdg_surface_listener, window);
gdk_wayland_window_sync_title (window);
xdg_surface_set_app_id (impl->xdg_surface, gdk_get_program_class ());
}
static void
@ -1135,14 +1152,6 @@ gdk_wayland_window_show (GdkWindow *window,
if (!impl->surface)
gdk_wayland_window_create_surface (window);
if (impl->xdg_surface)
{
if (impl->title)
xdg_surface_set_title (impl->xdg_surface, impl->title);
xdg_surface_set_app_id (impl->xdg_surface, gdk_get_program_class ());
}
gdk_window_set_type_hint (window, impl->hint);
_gdk_make_event (window, GDK_MAP, NULL, FALSE);
@ -1569,6 +1578,8 @@ gdk_wayland_window_set_title (GdkWindow *window,
g_free (impl->title);
impl->title = g_strdup (title);
gdk_wayland_window_sync_title (window);
}
static void