Caolán McNamara
2020-07-07 21:12:59 +01:00
parent b8b966ef80
commit 2b74662b2b
2 changed files with 35 additions and 11 deletions

View File

@ -77,6 +77,10 @@ GDK_AVAILABLE_IN_3_22
gboolean gdk_wayland_window_set_transient_for_exported (GdkWindow *window,
char *parent_handle_str);
GDK_AVAILABLE_IN_3_24
void gdk_wayland_window_set_application_id (GdkWindow *window,
const char *application_id);
GDK_AVAILABLE_IN_3_22
void gdk_wayland_window_announce_csd (GdkWindow *window);

View File

@ -1933,6 +1933,36 @@ create_zxdg_toplevel_v6_resources (GdkWindow *window)
window);
}
void
gdk_wayland_window_set_application_id (GdkWindow *window, const char* application_id)
{
GdkWindowImplWayland *impl;
GdkWaylandDisplay *display_wayland;
g_return_if_fail (application_id != NULL);
if (GDK_WINDOW_DESTROYED (window))
return;
if (!is_realized_toplevel (window))
return;
display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
switch (display_wayland->shell_variant)
{
case GDK_WAYLAND_SHELL_VARIANT_XDG_SHELL:
xdg_toplevel_set_app_id (impl->display_server.xdg_toplevel,
application_id);
break;
case GDK_WAYLAND_SHELL_VARIANT_ZXDG_SHELL_V6:
zxdg_toplevel_v6_set_app_id (impl->display_server.zxdg_toplevel_v6,
application_id);
break;
}
}
static void
gdk_wayland_window_create_xdg_toplevel (GdkWindow *window)
{
@ -1988,17 +2018,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
if (app_id == NULL)
app_id = gdk_get_program_class ();
switch (display_wayland->shell_variant)
{
case GDK_WAYLAND_SHELL_VARIANT_XDG_SHELL:
xdg_toplevel_set_app_id (impl->display_server.xdg_toplevel,
app_id);
break;
case GDK_WAYLAND_SHELL_VARIANT_ZXDG_SHELL_V6:
zxdg_toplevel_v6_set_app_id (impl->display_server.zxdg_toplevel_v6,
app_id);
break;
}
gdk_wayland_window_set_application_id (window, app_id);
maybe_set_gtk_surface_dbus_properties (window);
maybe_set_gtk_surface_modal (window);