diff options
| author | Skidam <67871298+Skidamek@users.noreply.github.com> | 2026-02-25 13:29:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-25 12:29:12 +0000 |
| commit | 457617b5a31f70ea63e1fcc0729f29e4a9e6b486 (patch) | |
| tree | 25353a5378ed609f3d15f2e157f7fa85c1121a82 /src/layout/target/WindowTarget.cpp | |
| parent | c60b3cb2ed0404d9573b2801b51ba7be1da999d9 (diff) | |
xwayland: normalize OR geometry to logical coords with force_zero_scaling (#13359)
Fixes X11 popups, tooltips, and menus showing black boxes on scaled monitors with xwayland:force_zero_scaling = 1 #13334
Diffstat (limited to 'src/layout/target/WindowTarget.cpp')
| -rw-r--r-- | src/layout/target/WindowTarget.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/layout/target/WindowTarget.cpp b/src/layout/target/WindowTarget.cpp index f19ba7ea..05c328af 100644 --- a/src/layout/target/WindowTarget.cpp +++ b/src/layout/target/WindowTarget.cpp @@ -266,6 +266,12 @@ std::expected<SGeometryRequested, eGeometryFailure> CWindowTarget::desiredGeomet return std::unexpected(GEOMETRY_NO_DESIRED); } + static auto PXWLFORCESCALEZERO = CConfigValue<Hyprlang::INT>("xwayland:force_zero_scaling"); + const auto toLogical = [&](SGeometryRequested& req) { + if (m_window->m_isX11 && *PXWLFORCESCALEZERO && PMONITOR) + req.size /= PMONITOR->m_scale; + }; + if (DESIRED_GEOM.width <= 2 || DESIRED_GEOM.height <= 2) { const auto SURFACE = m_window->wlSurface()->resource(); @@ -273,6 +279,7 @@ std::expected<SGeometryRequested, eGeometryFailure> CWindowTarget::desiredGeomet // center on mon and call it a day requested.pos.reset(); requested.size = clampSizeForDesired(SURFACE->m_current.size); + toLogical(requested); return requested; } @@ -285,6 +292,7 @@ std::expected<SGeometryRequested, eGeometryFailure> CWindowTarget::desiredGeomet if (m_window->m_xwaylandSurface->m_geometry.x != 0 && m_window->m_xwaylandSurface->m_geometry.y != 0) { requested.size = SIZE; requested.pos = g_pXWaylandManager->xwaylandToWaylandCoords(m_window->m_xwaylandSurface->m_geometry.pos()); + toLogical(requested); return requested; } } @@ -318,6 +326,7 @@ std::expected<SGeometryRequested, eGeometryFailure> CWindowTarget::desiredGeomet if (DESIRED_GEOM.w <= 2 || DESIRED_GEOM.h <= 2) return std::unexpected(GEOMETRY_NO_DESIRED); + toLogical(requested); return requested; } |
