aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/tree/view.h
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-06 14:49:33 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-07 11:07:29 +1000
commit1059e173f4c0139e909c7d8b5d450f30c0adad0e (patch)
treef14474b2d5118151129593443e5f8f785c3f6ab0 /include/sway/tree/view.h
parentMerge pull request #2778 from emersion/swaybar-seat-pointer (diff)
downloadsway-1059e173f4c0139e909c7d8b5d450f30c0adad0e.tar.gz
sway-1059e173f4c0139e909c7d8b5d450f30c0adad0e.tar.zst
sway-1059e173f4c0139e909c7d8b5d450f30c0adad0e.zip
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.
Diffstat (limited to 'include/sway/tree/view.h')
-rw-r--r--include/sway/tree/view.h3
1 files changed, 3 insertions, 0 deletions
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 {
206struct sway_view_child; 206struct sway_view_child;
207 207
208struct sway_view_child_impl { 208struct sway_view_child_impl {
209 void (*get_root_coords)(struct sway_view_child *child, int *sx, int *sy);
209 void (*destroy)(struct sway_view_child *child); 210 void (*destroy)(struct sway_view_child *child);
210}; 211};
211 212
@@ -220,6 +221,8 @@ struct sway_view_child {
220 221
221 struct wl_listener surface_commit; 222 struct wl_listener surface_commit;
222 struct wl_listener surface_new_subsurface; 223 struct wl_listener surface_new_subsurface;
224 struct wl_listener surface_map;
225 struct wl_listener surface_unmap;
223 struct wl_listener surface_destroy; 226 struct wl_listener surface_destroy;
224 struct wl_listener view_unmap; 227 struct wl_listener view_unmap;
225}; 228};