wayland: Explicitly announce ssd for kwin

Without this, kwin correctly assumes that we are
using client-side decorations. This is a port
of 32ae97f1 from GTK 3.24.

Fixes: #3609
This commit is contained in:
Matthias Clasen 2021-01-21 22:43:33 -05:00
parent d24b8a094c
commit 6c54abeca7
3 changed files with 26 additions and 2 deletions

View File

@ -2223,6 +2223,24 @@ gdk_wayland_toplevel_announce_csd (GdkToplevel *toplevel)
ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_CLIENT);
}
void
gdk_wayland_toplevel_announce_ssd (GdkToplevel *toplevel)
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (GDK_SURFACE (toplevel)));
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (toplevel);
g_return_if_fail (GDK_IS_WAYLAND_TOPLEVEL (toplevel));
if (!display_wayland->server_decoration_manager)
return;
impl->display_server.server_decoration =
org_kde_kwin_server_decoration_manager_create (display_wayland->server_decoration_manager,
impl->display_server.wl_surface);
if (impl->display_server.server_decoration)
org_kde_kwin_server_decoration_request_mode (impl->display_server.server_decoration,
ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_SERVER);
}
gboolean
gdk_wayland_toplevel_inhibit_idle (GdkToplevel *toplevel)
{

View File

@ -33,6 +33,7 @@ void gdk_wayland_toplevel_set_dbus_properties (GdkTopl
const char *unique_bus_name);
void gdk_wayland_toplevel_announce_csd (GdkToplevel *toplevel);
void gdk_wayland_toplevel_announce_ssd (GdkToplevel *toplevel);
gboolean gdk_wayland_toplevel_inhibit_idle (GdkToplevel *toplevel);
void gdk_wayland_toplevel_uninhibit_idle (GdkToplevel *toplevel);

View File

@ -4204,8 +4204,13 @@ gtk_window_realize (GtkWidget *widget)
gdk_toplevel_set_deletable (GDK_TOPLEVEL (surface), priv->deletable);
#ifdef GDK_WINDOWING_WAYLAND
if (priv->client_decorated && GDK_IS_WAYLAND_SURFACE (surface))
gdk_wayland_toplevel_announce_csd (GDK_TOPLEVEL (surface));
if (GDK_IS_WAYLAND_SURFACE (surface))
{
if (priv->client_decorated)
gdk_wayland_toplevel_announce_csd (GDK_TOPLEVEL (surface));
else
gdk_wayland_toplevel_announce_ssd (GDK_TOPLEVEL (surface));
}
#endif
gdk_toplevel_set_modal (GDK_TOPLEVEL (surface), priv->modal);