From 5ce5a8abcc760100d09a84f995e1419722e52235 Mon Sep 17 00:00:00 2001 From: dragonn Date: Thu, 23 Dec 2021 17:49:39 +0100 Subject: [PATCH] call resize after applying new pending model --- src/backend/drm/surface/gbm.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backend/drm/surface/gbm.rs b/src/backend/drm/surface/gbm.rs index 3bc5be0..c587dd2 100644 --- a/src/backend/drm/surface/gbm.rs +++ b/src/backend/drm/surface/gbm.rs @@ -309,8 +309,11 @@ where /// Fails if the mode is not compatible with the underlying /// [`crtc`](drm::control::crtc) or any of the /// pending [`connector`](drm::control::connector)s. - pub fn use_mode(&self, mode: Mode) -> Result<(), Error> { - self.drm.use_mode(mode).map_err(Error::DrmError) + pub fn use_mode(&mut self, mode: Mode) -> Result<(), Error> { + self.drm.use_mode(mode).map_err(Error::DrmError)?; + let (w, h) = mode.size(); + self.swapchain.resize(w as _, h as _); + Ok(()) } }