From cb91f44ba473b3d46dd8cc95774ff5b161a82e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 5 Jul 2019 17:43:24 +0200 Subject: [PATCH] wayland/wl-shell: Use input region as window geometry if set Historically, wl_shell clients used to pretend the input region was equivalent to the window geometry, so for "correctness" lets do that here too. This makes wl_shell clients with drop shadow behave marginally better than before. https://gitlab.gnome.org/GNOME/mutter/merge_requests/907 --- src/wayland/meta-wayland-wl-shell.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/wayland/meta-wayland-wl-shell.c b/src/wayland/meta-wayland-wl-shell.c index 6ab29ce64..12d0dee0b 100644 --- a/src/wayland/meta-wayland-wl-shell.c +++ b/src/wayland/meta-wayland-wl-shell.c @@ -573,6 +573,7 @@ wl_shell_surface_role_commit (MetaWaylandSurfaceRole *surface_role, MetaWaylandSurface *surface = meta_wayland_surface_role_get_surface (surface_role); MetaWindow *window = surface->window; + cairo_region_t *input_region; MetaRectangle geom = { 0 }; surface_role_class = @@ -601,7 +602,17 @@ wl_shell_surface_role_commit (MetaWaylandSurfaceRole *surface_role, if (!pending->newly_attached) return; - meta_wayland_shell_surface_calculate_geometry (shell_surface, &geom); + input_region = meta_wayland_surface_calculate_input_region (surface); + if (!cairo_region_is_empty (input_region)) + { + cairo_region_get_extents (input_region, &geom); + cairo_region_destroy (input_region); + } + else + { + meta_wayland_shell_surface_calculate_geometry (shell_surface, &geom); + } + meta_window_wayland_finish_move_resize (window, NULL, geom, pending->dx, pending->dy);