From 1059e173f4c0139e909c7d8b5d450f30c0adad0e Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 6 Oct 2018 14:49:33 +1000 Subject: Only damage popups when popups have damage The previous behaviour was to damage the entire view, which would recurse into each popup. This patch makes it damage only the popup's surface, and respect the surface damage given by the client. This adds listeners to the popup's map and unmap events rather than doing the damage in the create and destroy functions. To get the popup's position relative to the view, a new child_impl function get_root_coords has been introduced, which traverses up the parents. --- include/sway/tree/view.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/sway/tree') diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 028be536..eed3d13d 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -206,6 +206,7 @@ struct sway_xwayland_unmanaged { struct sway_view_child; struct sway_view_child_impl { + void (*get_root_coords)(struct sway_view_child *child, int *sx, int *sy); void (*destroy)(struct sway_view_child *child); }; @@ -220,6 +221,8 @@ struct sway_view_child { struct wl_listener surface_commit; struct wl_listener surface_new_subsurface; + struct wl_listener surface_map; + struct wl_listener surface_unmap; struct wl_listener surface_destroy; struct wl_listener view_unmap; }; -- cgit v1.2.3-54-g00ecf