diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-09 00:02:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-09 00:02:36 +0200 |
commit | 4bebee620f1160d6531d9aaa9b528029f75cecf4 (patch) | |
tree | 14fb50168c3ba60446b11b786ea69b8fa07b767f /sway/desktop/xdg_shell.c | |
parent | Merge pull request #2782 from RyanDwyer/popup-during-fullscreen (diff) | |
parent | Handle subsurfaces in view_child_damage (diff) | |
download | sway-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.c')
-rw-r--r-- | sway/desktop/xdg_shell.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index 4690a3c5..46582204 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -20,6 +20,17 @@ | |||
20 | 20 | ||
21 | static const struct sway_view_child_impl popup_impl; | 21 | static const struct sway_view_child_impl popup_impl; |
22 | 22 | ||
23 | static void popup_get_root_coords(struct sway_view_child *child, | ||
24 | int *root_sx, int *root_sy) { | ||
25 | struct sway_xdg_popup *popup = (struct sway_xdg_popup *)child; | ||
26 | struct wlr_xdg_surface *surface = popup->wlr_xdg_surface; | ||
27 | |||
28 | wlr_xdg_popup_get_toplevel_coords(surface->popup, | ||
29 | -surface->geometry.x + surface->popup->geometry.x, | ||
30 | -surface->geometry.y + surface->popup->geometry.y, | ||
31 | root_sx, root_sy); | ||
32 | } | ||
33 | |||
23 | static void popup_destroy(struct sway_view_child *child) { | 34 | static void popup_destroy(struct sway_view_child *child) { |
24 | if (!sway_assert(child->impl == &popup_impl, | 35 | if (!sway_assert(child->impl == &popup_impl, |
25 | "Expected an xdg_shell popup")) { | 36 | "Expected an xdg_shell popup")) { |
@@ -32,6 +43,7 @@ static void popup_destroy(struct sway_view_child *child) { | |||
32 | } | 43 | } |
33 | 44 | ||
34 | static const struct sway_view_child_impl popup_impl = { | 45 | static const struct sway_view_child_impl popup_impl = { |
46 | .get_root_coords = popup_get_root_coords, | ||
35 | .destroy = popup_destroy, | 47 | .destroy = popup_destroy, |
36 | }; | 48 | }; |
37 | 49 | ||
@@ -85,6 +97,9 @@ static struct sway_xdg_popup *popup_create( | |||
85 | wl_signal_add(&xdg_surface->events.destroy, &popup->destroy); | 97 | wl_signal_add(&xdg_surface->events.destroy, &popup->destroy); |
86 | popup->destroy.notify = popup_handle_destroy; | 98 | popup->destroy.notify = popup_handle_destroy; |
87 | 99 | ||
100 | wl_signal_add(&xdg_surface->events.map, &popup->child.surface_map); | ||
101 | wl_signal_add(&xdg_surface->events.unmap, &popup->child.surface_unmap); | ||
102 | |||
88 | popup_unconstrain(popup); | 103 | popup_unconstrain(popup); |
89 | 104 | ||
90 | return popup; | 105 | return popup; |