Commit b262ec719ab6
tarball1 file changed+10-0
@@ -228,6 +228,7 @@ impl State {
228228
}229229
self.confirm_lock();230230
self.complete_captures();231
+ self.exit_if_gpu_lost();231232
if std::mem::take(&mut self.dirty.snapshot) {232233
crate::ipc::broadcast(self);233234
self.publish_workspaces();@@ -236,6 +237,15 @@ impl State {
236237
let _ = self.core.display.flush_clients();237238
}238239
240
+ /// A lost or hung GPU cannot be recovered in place, so the loop stops the241
+ /// way `msg quit` does and the session restarts the compositor.242
+ fn exit_if_gpu_lost(&self) {243
+ if monolith_render_vk::device_lost() {244
+ tracing::error!("the GPU was lost or stopped responding, exiting");245
+ self.core.signal.stop();246
+ }247
+ }248
+239249
pub fn resize_output(&mut self, size: Size<i32, Logical>) {240250
if let Some(host) = self.backend.nested() {241251
let o = host.output_id;