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;
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;

View File

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