aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell_v6.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-10-09 00:02:36 +0200
committerLibravatar GitHub <noreply@github.com>2018-10-09 00:02:36 +0200
commit4bebee620f1160d6531d9aaa9b528029f75cecf4 (patch)
tree14fb50168c3ba60446b11b786ea69b8fa07b767f /sway/desktop/xdg_shell_v6.c
parentMerge pull request #2782 from RyanDwyer/popup-during-fullscreen (diff)
parentHandle subsurfaces in view_child_damage (diff)
downloadsway-4bebee620f1160d6531d9aaa9b528029f75cecf4.tar.gz
sway-4bebee620f1160d6531d9aaa9b528029f75cecf4.tar.zst
sway-4bebee620f1160d6531d9aaa9b528029f75cecf4.zip
Merge pull request #2772 from RyanDwyer/improve-popup-damage
Only damage popups when popups have damage
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r--sway/desktop/xdg_shell_v6.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index ff950c70..165cc7eb 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -19,6 +19,17 @@
19 19
20static const struct sway_view_child_impl popup_impl; 20static const struct sway_view_child_impl popup_impl;
21 21
22static void popup_get_root_coords(struct sway_view_child *child,
23 int *root_sx, int *root_sy) {
24 struct sway_xdg_popup_v6 *popup = (struct sway_xdg_popup_v6 *)child;
25 struct wlr_xdg_surface_v6 *surface = popup->wlr_xdg_surface_v6;
26
27 wlr_xdg_popup_v6_get_toplevel_coords(surface->popup,
28 -surface->geometry.x + surface->popup->geometry.x,
29 -surface->geometry.y + surface->popup->geometry.y,
30 root_sx, root_sy);
31}
32
22static void popup_destroy(struct sway_view_child *child) { 33static void popup_destroy(struct sway_view_child *child) {
23 if (!sway_assert(child->impl == &popup_impl, 34 if (!sway_assert(child->impl == &popup_impl,
24 "Expected an xdg_shell_v6 popup")) { 35 "Expected an xdg_shell_v6 popup")) {
@@ -31,6 +42,7 @@ static void popup_destroy(struct sway_view_child *child) {
31} 42}
32 43
33static const struct sway_view_child_impl popup_impl = { 44static const struct sway_view_child_impl popup_impl = {
45 .get_root_coords = popup_get_root_coords,
34 .destroy = popup_destroy, 46 .destroy = popup_destroy,
35}; 47};
36 48
@@ -84,6 +96,9 @@ static struct sway_xdg_popup_v6 *popup_create(
84 wl_signal_add(&xdg_surface->events.destroy, &popup->destroy); 96 wl_signal_add(&xdg_surface->events.destroy, &popup->destroy);
85 popup->destroy.notify = popup_handle_destroy; 97 popup->destroy.notify = popup_handle_destroy;
86 98
99 wl_signal_add(&xdg_surface->events.map, &popup->child.surface_map);
100 wl_signal_add(&xdg_surface->events.unmap, &popup->child.surface_unmap);
101
87 popup_unconstrain(popup); 102 popup_unconstrain(popup);
88 103
89 return popup; 104 return popup;