From 1651b02cc1c86a170162709981694558fc16dcc4 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Thu, 2 May 2024 15:17:04 +0100 Subject: [PATCH] core: update renderer on late scale changes ref https://github.com/hyprwm/Hyprland/issues/5842, in case a compositor sends the scale after configure --- src/core/LockSurface.cpp | 7 +++++++ src/core/LockSurface.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/src/core/LockSurface.cpp b/src/core/LockSurface.cpp index d0acd5f..8446354 100644 --- a/src/core/LockSurface.cpp +++ b/src/core/LockSurface.cpp @@ -17,6 +17,9 @@ static void handlePreferredScale(void* data, wp_fractional_scale_v1* wp_fraction const auto PSURF = (CSessionLockSurface*)data; PSURF->fractionalScale = scale / 120.0; Debug::log(LOG, "got fractional {}", PSURF->fractionalScale); + + if (PSURF->readyForFrame) + PSURF->onScaleUpdate(); } static const wp_fractional_scale_v1_listener fsListener = { @@ -103,6 +106,10 @@ void CSessionLockSurface::configure(const Vector2D& size_, uint32_t serial_) { render(); } +void CSessionLockSurface::onScaleUpdate() { + configure(size, serial); +} + static void handleDone(void* data, wl_callback* wl_callback, uint32_t callback_data) { const auto PSURF = (CSessionLockSurface*)data; diff --git a/src/core/LockSurface.hpp b/src/core/LockSurface.hpp index 2f93521..046b971 100644 --- a/src/core/LockSurface.hpp +++ b/src/core/LockSurface.hpp @@ -24,6 +24,7 @@ class CSessionLockSurface { void render(); void onCallback(); + void onScaleUpdate(); private: COutput* output = nullptr;