mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-09-20 14:00:10 +00:00
gtk#767 add a way to change the application_id of a toplevel wayland GdkSurface
so LibreOffice can reuse toplevels and get the right task icons
references;
https://gitlab.gnome.org/GNOME/gtk/-/issues/767
https://lists.freedesktop.org/archives/wayland-devel/2019-July/040704.html
e0d6ad1d5e
https://bugs.documentfoundation.org/show_bug.cgi?id=125934
https://bugzilla.redhat.com/show_bug.cgi?id=1334915
https://bugreports.qt.io/browse/QTBUG-77182
This commit is contained in:
parent
2bf5a150e6
commit
7e97c2513f
@ -1648,6 +1648,38 @@ create_zxdg_toplevel_v6_resources (GdkSurface *surface)
|
||||
surface);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_surface_set_application_id (GdkSurface *surface, const char* application_id)
|
||||
{
|
||||
GdkWaylandSurface *impl;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
|
||||
g_return_if_fail (application_id != NULL);
|
||||
|
||||
if (GDK_SURFACE_DESTROYED (surface))
|
||||
return;
|
||||
|
||||
if (!is_realized_toplevel (surface))
|
||||
return;
|
||||
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
|
||||
impl = GDK_WAYLAND_SURFACE (surface);
|
||||
|
||||
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;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_surface_create_xdg_toplevel (GdkSurface *surface)
|
||||
{
|
||||
@ -1702,19 +1734,7 @@ gdk_wayland_surface_create_xdg_toplevel (GdkSurface *surface)
|
||||
if (app_id == NULL)
|
||||
app_id = "GTK+ Application";
|
||||
|
||||
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;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
gdk_wayland_surface_set_application_id (surface, app_id);
|
||||
|
||||
maybe_set_gtk_surface_dbus_properties (surface);
|
||||
maybe_set_gtk_surface_modal (surface);
|
||||
|
@ -74,6 +74,10 @@ GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_wayland_surface_set_transient_for_exported (GdkSurface *surface,
|
||||
char *parent_handle_str);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_wayland_surface_set_application_id (GdkSurface *surface,
|
||||
const char *application_id);
|
||||
|
||||
void gdk_wayland_surface_announce_csd (GdkSurface *surface);
|
||||
|
||||
G_END_DECLS
|
||||
|
Loading…
Reference in New Issue
Block a user