fixup ls geom calcs on wp-fs-v1

This commit is contained in:
vaxerski 2023-02-08 22:54:26 +00:00
parent cb6c47098d
commit 859d6b9b8a
1 changed files with 9 additions and 2 deletions

View File

@ -309,8 +309,15 @@ void Events::listener_commitLayerSurface(void* owner, void* data) {
layersurface->position = Vector2D(layersurface->geometry.x, layersurface->geometry.y);
// update geom if it changed
layersurface->geometry = {layersurface->geometry.x, layersurface->geometry.y, (int)layersurface->layerSurface->surface->current.width,
(int)layersurface->layerSurface->surface->current.height};
if (layersurface->layerSurface->surface->current.scale == 1 && PMONITOR->scale != 1.f) {
// fractional scaling. Dirty hack.
layersurface->geometry = {layersurface->geometry.x, layersurface->geometry.y, (int)(layersurface->layerSurface->surface->current.width / PMONITOR->scale),
(int)(layersurface->layerSurface->surface->current.height / PMONITOR->scale)};
} else {
// this is because some apps like e.g. rofi-lbonn can't fucking use the protocol correctly.
layersurface->geometry = {layersurface->geometry.x, layersurface->geometry.y, (int)layersurface->layerSurface->surface->current.width,
(int)layersurface->layerSurface->surface->current.height};
}
}
g_pHyprRenderer->damageSurface(layersurface->layerSurface->surface, layersurface->position.x, layersurface->position.y);