diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2022-08-28 10:14:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-28 10:14:43 +0200 |
| commit | 52c0ba544c55695b0fb0e3c5e9871fe599f7d36d (patch) | |
| tree | fe41941854970f4ef9dcd20627fe49ae18a21883 /src/events/Popups.cpp | |
| parent | 8b5c64c8fd1e911965a217ee4980a327208afdf7 (diff) | |
Viewporter implementaion (#585)
Implementation of the `wp_viewporter` core protocol and some bugfixes
Diffstat (limited to 'src/events/Popups.cpp')
| -rw-r--r-- | src/events/Popups.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/events/Popups.cpp b/src/events/Popups.cpp index f48f71be..5f5dbdab 100644 --- a/src/events/Popups.cpp +++ b/src/events/Popups.cpp @@ -18,14 +18,20 @@ 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; py += curPopup->popup->current.geometry.y; + if (curPopup == PPOPUP && PPOPUP->parentWindow) { + px -= curPopup->popup->base->current.geometry.x; + py -= curPopup->popup->base->current.geometry.y; + } + // fix oversized fucking popups // kill me if (curPopup->pSurfaceTree && curPopup->pSurfaceTree->pSurface && !curPopup->parentPopup) { |
