aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/events/Layers.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp
index 28c54ab4..34631136 100644
--- a/src/events/Layers.cpp
+++ b/src/events/Layers.cpp
@@ -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);