fix: resume direct rendering after session activation

This commit is contained in:
Samuel Onoja committed 2026-09-24 16:36:49 +01:00
1 parent 179495f2c6
commit 74bdc04c10
1 file changed
+7 -2
+7 -2
View File
@@ -80,10 +80,14 @@ pub fn init(event_loop: &mut EventLoop<Ferese>, state: &mut Ferese) -> Result<()
.udev_assign_seat(&seat_name) .udev_assign_seat(&seat_name)
.map_err(|()| io::Error::other(format!("failed to assign libinput seat {seat_name}")))?; .map_err(|()| io::Error::other(format!("failed to assign libinput seat {seat_name}")))?;
let libinput_backend = LibinputInputBackend::new(libinput_context.clone()); let libinput_backend = LibinputInputBackend::new(libinput_context.clone());
let session_active = session.is_active();
if !session_active {
libinput_context.suspend();
}
state.direct_backend = Some(DirectBackendState { state.direct_backend = Some(DirectBackendState {
session, session,
active: true, active: session_active,
devices: HashMap::new(), devices: HashMap::new(),
presentation: PresentationClock::default(), presentation: PresentationClock::default(),
}); });
@@ -116,12 +120,13 @@ pub fn init(event_loop: &mut EventLoop<Ferese>, state: &mut Ferese) -> Result<()
if let Some(backend) = state.direct_backend.as_mut() { if let Some(backend) = state.direct_backend.as_mut() {
backend.active = true; backend.active = true;
for device in backend.devices.values_mut() { for device in backend.devices.values_mut() {
if let Err(error) = device.drm.activate(false) { if let Err(error) = device.drm.activate(true) {
tracing::error!(%error, "failed to reactivate DRM device"); tracing::error!(%error, "failed to reactivate DRM device");
} }
} }
} }
tracing::info!("direct session activated"); tracing::info!("direct session activated");
render_all(state);
} }
})?; })?;
event_loop event_loop