summaryrefslogtreecommitdiff
path: root/src/events/Windows.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-08-21 00:39:39 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-08-21 00:39:39 +0200
commit025c023e4bbe22fc61a9dc39a33c0c14495230be (patch)
tree8a7b5c99b64e9b837d293023ba37b56009c2da9e /src/events/Windows.cpp
parent09cc96c0d57512e9db801a3888a0d9c773c79dc2 (diff)
xwayland: use logical pos in unmanaged geom requests
using raw xwayland coords is wrong cuz we use separate coord spaces
Diffstat (limited to 'src/events/Windows.cpp')
-rw-r--r--src/events/Windows.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 70d3f655..02ccd950 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -1048,13 +1048,15 @@ void Events::listener_unmanagedSetGeometry(void* owner, void* data) {
static auto* const PXWLFORCESCALEZERO = &g_pConfigManager->getConfigValuePtr("xwayland:force_zero_scaling")->intValue;
- if (abs(std::floor(POS.x) - PWINDOW->m_uSurface.xwayland->x) > 2 || abs(std::floor(POS.y) - PWINDOW->m_uSurface.xwayland->y) > 2 ||
- abs(std::floor(SIZ.x) - PWINDOW->m_uSurface.xwayland->width) > 2 || abs(std::floor(SIZ.y) - PWINDOW->m_uSurface.xwayland->height) > 2) {
- Debug::log(LOG, "Unmanaged window %lx requests geometry update to %i %i %i %i", PWINDOW, (int)PWINDOW->m_uSurface.xwayland->x, (int)PWINDOW->m_uSurface.xwayland->y,
- (int)PWINDOW->m_uSurface.xwayland->width, (int)PWINDOW->m_uSurface.xwayland->height);
+ const auto LOGICALPOS = g_pXWaylandManager->xwaylandToWaylandCoords({PWINDOW->m_uSurface.xwayland->x, PWINDOW->m_uSurface.xwayland->y});
+
+ if (abs(std::floor(POS.x) - LOGICALPOS.x) > 2 || abs(std::floor(POS.y) - LOGICALPOS.y) > 2 || abs(std::floor(SIZ.x) - PWINDOW->m_uSurface.xwayland->width) > 2 ||
+ abs(std::floor(SIZ.y) - PWINDOW->m_uSurface.xwayland->height) > 2) {
+ Debug::log(LOG, "Unmanaged window %lx requests geometry update to %i %i %i %i", PWINDOW, (int)LOGICALPOS.x, (int)LOGICALPOS.y, (int)PWINDOW->m_uSurface.xwayland->width,
+ (int)PWINDOW->m_uSurface.xwayland->height);
g_pHyprRenderer->damageWindow(PWINDOW);
- PWINDOW->m_vRealPosition.setValueAndWarp(Vector2D(PWINDOW->m_uSurface.xwayland->x, PWINDOW->m_uSurface.xwayland->y));
+ PWINDOW->m_vRealPosition.setValueAndWarp(Vector2D(LOGICALPOS.x, LOGICALPOS.y));
if (abs(std::floor(SIZ.x) - PWINDOW->m_uSurface.xwayland->width) > 2 || abs(std::floor(SIZ.y) - PWINDOW->m_uSurface.xwayland->height) > 2)
PWINDOW->m_vRealSize.setValueAndWarp(Vector2D(PWINDOW->m_uSurface.xwayland->width, PWINDOW->m_uSurface.xwayland->height));