aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-08-27 14:11:23 +0200
committervaxerski <[email protected]>2022-08-27 14:11:23 +0200
commit78491f709253987694f2e9d51fb0f877748c33e9 (patch)
treeb8bb909c7affe72f5eeb66ae729bf2e7e4dbbb3a
parentc46be7346ef6c478e5c0460862815278906d1bf4 (diff)
downloadHyprland-78491f709253987694f2e9d51fb0f877748c33e9.tar.gz
Hyprland-78491f709253987694f2e9d51fb0f877748c33e9.zip
fix popup coords iterator
-rw-r--r--src/events/Popups.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/events/Popups.cpp b/src/events/Popups.cpp
index d17f615e..6be94453 100644
--- a/src/events/Popups.cpp
+++ b/src/events/Popups.cpp
@@ -18,13 +18,19 @@
void addPopupGlobalCoords(void* pPopup, int* x, int* y) {
SXDGPopup *const PPOPUP = (SXDGPopup*)pPopup;
+ auto curPopup = PPOPUP;
+
int px = 0;
int py = 0;
- auto curPopup = PPOPUP;
while (true) {
- px += curPopup->popup->current.geometry.x - curPopup->popup->base->current.geometry.x;
- py += curPopup->popup->current.geometry.y - curPopup->popup->base->current.geometry.y;
+ px += curPopup->popup->current.geometry.x;
+ py += curPopup->popup->current.geometry.y;
+
+ if (curPopup == PPOPUP) {
+ px -= curPopup->popup->base->current.geometry.x;
+ py -= curPopup->popup->base->current.geometry.y;
+ }
// fix oversized fucking popups
// kill me