diff options
author | vaxerski <[email protected]> | 2022-08-27 22:03:57 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-08-27 22:03:57 +0200 |
commit | 47a4ea21caeee925646448b22a752a788c160f15 (patch) | |
tree | 430e914f9e34d16ac39d0b0c2a6d78d3c70b5d98 | |
parent | 96aaa73d9c6210e733a9261cbf048be0775e1687 (diff) | |
download | Hyprland-47a4ea21caeee925646448b22a752a788c160f15.tar.gz Hyprland-47a4ea21caeee925646448b22a752a788c160f15.zip |
fix popup positioning in render
-rw-r--r-- | src/events/Popups.cpp | 5 | ||||
-rw-r--r-- | src/render/Renderer.cpp | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/events/Popups.cpp b/src/events/Popups.cpp index d0190fcf..6be94453 100644 --- a/src/events/Popups.cpp +++ b/src/events/Popups.cpp @@ -27,6 +27,11 @@ void addPopupGlobalCoords(void* pPopup, int* x, int* 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 if (curPopup->pSurfaceTree && curPopup->pSurfaceTree->pSurface && !curPopup->parentPopup) { diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index cd81e19a..23ee5f11 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -246,6 +246,12 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec* if (mode == RENDER_PASS_ALL || mode == RENDER_PASS_POPUP) { if (!pWindow->m_bIsX11) { + wlr_box geom; + wlr_xdg_surface_get_geometry(pWindow->m_uSurface.xdg, &geom); + + renderdata.x -= geom.x; + renderdata.y -= geom.y; + renderdata.dontRound = true; // don't round popups renderdata.pMonitor = pMonitor; renderdata.squishOversized = false; // don't squish popups |