aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksei Bavshin <alebastr89@gmail.com>2020-02-21 22:22:28 -0800
committerSimon Ser <contact@emersion.fr>2020-02-26 13:43:53 +0100
commitc99d156f0d626e637cefd4e2bf6f04af648fd873 (patch)
treebdfcc7bc4930a2a3e8069c07cf47f64c8bd44ecc
parent3ff6a5def349db21c9f7d83c0406ce5cebfa9a09 (diff)
xdg-shell: fix popups rendered outside of the screen
Leave positioner inverted on the individual axis if it's no longer constrained. Otherwise constraint adjustment like `slide_x & flip_y` could render popup outside of the screen when both axes are constrained. Fixes Alexays/Waybar#532
-rw-r--r--types/xdg_shell/wlr_xdg_popup.c4
-rw-r--r--types/xdg_shell_v6/wlr_xdg_popup_v6.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/types/xdg_shell/wlr_xdg_popup.c b/types/xdg_shell/wlr_xdg_popup.c
index fd608a95..3239ea19 100644
--- a/types/xdg_shell/wlr_xdg_popup.c
+++ b/types/xdg_shell/wlr_xdg_popup.c
@@ -454,10 +454,10 @@ static bool xdg_popup_unconstrain_flip(struct wlr_xdg_popup *popup,
}
// revert the positioner back if it didn't fix it and go to the next part
- if (flip_x) {
+ if (offset_x && flip_x) {
wlr_positioner_invert_x(&popup->positioner);
}
- if (flip_y) {
+ if (offset_y && flip_y) {
wlr_positioner_invert_y(&popup->positioner);
}
diff --git a/types/xdg_shell_v6/wlr_xdg_popup_v6.c b/types/xdg_shell_v6/wlr_xdg_popup_v6.c
index 7d3e06fc..54c583bd 100644
--- a/types/xdg_shell_v6/wlr_xdg_popup_v6.c
+++ b/types/xdg_shell_v6/wlr_xdg_popup_v6.c
@@ -474,10 +474,10 @@ static bool xdg_popup_v6_unconstrain_flip(struct wlr_xdg_popup_v6 *popup,
}
// revert the positioner back if it didn't fix it and go to the next part
- if (flip_x) {
+ if (offset_x && flip_x) {
wlr_positioner_v6_invert_x(&popup->positioner);
}
- if (flip_y) {
+ if (offset_y && flip_y) {
wlr_positioner_v6_invert_y(&popup->positioner);
}