core: update renderer on late scale changes

ref https://github.com/hyprwm/Hyprland/issues/5842, in case a compositor sends the scale after configure
This commit is contained in:
Vaxry 2024-05-02 15:17:04 +01:00
parent 415262065f
commit 1651b02cc1
2 changed files with 8 additions and 0 deletions

View file

@ -17,6 +17,9 @@ static void handlePreferredScale(void* data, wp_fractional_scale_v1* wp_fraction
const auto PSURF = (CSessionLockSurface*)data; const auto PSURF = (CSessionLockSurface*)data;
PSURF->fractionalScale = scale / 120.0; PSURF->fractionalScale = scale / 120.0;
Debug::log(LOG, "got fractional {}", PSURF->fractionalScale); Debug::log(LOG, "got fractional {}", PSURF->fractionalScale);
if (PSURF->readyForFrame)
PSURF->onScaleUpdate();
} }
static const wp_fractional_scale_v1_listener fsListener = { static const wp_fractional_scale_v1_listener fsListener = {
@ -103,6 +106,10 @@ void CSessionLockSurface::configure(const Vector2D& size_, uint32_t serial_) {
render(); render();
} }
void CSessionLockSurface::onScaleUpdate() {
configure(size, serial);
}
static void handleDone(void* data, wl_callback* wl_callback, uint32_t callback_data) { static void handleDone(void* data, wl_callback* wl_callback, uint32_t callback_data) {
const auto PSURF = (CSessionLockSurface*)data; const auto PSURF = (CSessionLockSurface*)data;

View file

@ -24,6 +24,7 @@ class CSessionLockSurface {
void render(); void render();
void onCallback(); void onCallback();
void onScaleUpdate();
private: private:
COutput* output = nullptr; COutput* output = nullptr;