aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2023-11-10 23:49:23 +0000
committerVaxry <[email protected]>2023-11-10 23:49:35 +0000
commit427153e86ad7070ea0e4d39f7fd348b8f720e055 (patch)
treeb3732acfaeb5ee5990fffadaea7441c61deb64b0
parent1e6e9b66a5837d62d374edd405bdf561813ebbce (diff)
downloadHyprland-427153e86ad7070ea0e4d39f7fd348b8f720e055.tar.gz
Hyprland-427153e86ad7070ea0e4d39f7fd348b8f720e055.zip
xwayland: add half of delta to configure request sizes
-rw-r--r--src/events/Windows.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index e44fa0a9..c6c9024e 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -1059,8 +1059,11 @@ void Events::listener_configureX11(void* owner, void* data) {
static auto* const PXWLFORCESCALEZERO = &g_pConfigManager->getConfigValuePtr("xwayland:force_zero_scaling")->intValue;
if (*PXWLFORCESCALEZERO) {
- if (const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); PMONITOR)
+ if (const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); PMONITOR) {
+ const Vector2D DELTA = PWINDOW->m_vRealSize.goalv() - PWINDOW->m_vRealSize.goalv() / PMONITOR->scale;
PWINDOW->m_vRealSize.setValueAndWarp(PWINDOW->m_vRealSize.goalv() / PMONITOR->scale);
+ PWINDOW->m_vRealPosition.setValueAndWarp(PWINDOW->m_vRealPosition.goalv() + DELTA / 2.0);
+ }
}
PWINDOW->m_vPosition = PWINDOW->m_vRealPosition.vec();
@@ -1120,8 +1123,11 @@ void Events::listener_unmanagedSetGeometry(void* owner, void* data) {
PWINDOW->m_vRealSize.setValueAndWarp(Vector2D(PWINDOW->m_uSurface.xwayland->width, PWINDOW->m_uSurface.xwayland->height));
if (*PXWLFORCESCALEZERO) {
- if (const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); PMONITOR)
+ if (const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); PMONITOR) {
+ const Vector2D DELTA = PWINDOW->m_vRealSize.goalv() - PWINDOW->m_vRealSize.goalv() / PMONITOR->scale;
PWINDOW->m_vRealSize.setValueAndWarp(PWINDOW->m_vRealSize.goalv() / PMONITOR->scale);
+ PWINDOW->m_vRealPosition.setValueAndWarp(PWINDOW->m_vRealPosition.goalv() + DELTA / 2.0);
+ }
}
PWINDOW->m_vPosition = PWINDOW->m_vRealPosition.goalv();