mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-24 02:01:18 +07:00
Register deadline timer for closing transaction
This commit is contained in:
@@ -219,9 +219,15 @@ impl CompositorHandler for State {
|
|||||||
id: u64::from(id.get()),
|
id: u64::from(id.get()),
|
||||||
});
|
});
|
||||||
|
|
||||||
self.niri.layout.remove_window(&window, transaction);
|
self.niri.layout.remove_window(&window, transaction.clone());
|
||||||
self.add_default_dmabuf_pre_commit_hook(surface);
|
self.add_default_dmabuf_pre_commit_hook(surface);
|
||||||
|
|
||||||
|
// If this is the only instance, then this transaction will complete
|
||||||
|
// immediately, so no need to set the timer.
|
||||||
|
if !transaction.is_last() {
|
||||||
|
transaction.register_deadline_timer(&self.niri.event_loop);
|
||||||
|
}
|
||||||
|
|
||||||
if was_active {
|
if was_active {
|
||||||
self.maybe_warp_cursor_to_focus();
|
self.maybe_warp_cursor_to_focus();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -498,9 +498,15 @@ impl XdgShellHandler for State {
|
|||||||
let active_window = self.niri.layout.active_window().map(|(m, _)| &m.window);
|
let active_window = self.niri.layout.active_window().map(|(m, _)| &m.window);
|
||||||
let was_active = active_window == Some(&window);
|
let was_active = active_window == Some(&window);
|
||||||
|
|
||||||
self.niri.layout.remove_window(&window, transaction);
|
self.niri.layout.remove_window(&window, transaction.clone());
|
||||||
self.add_default_dmabuf_pre_commit_hook(surface.wl_surface());
|
self.add_default_dmabuf_pre_commit_hook(surface.wl_surface());
|
||||||
|
|
||||||
|
// If this is the only instance, then this transaction will complete immediately, so no
|
||||||
|
// need to set the timer.
|
||||||
|
if !transaction.is_last() {
|
||||||
|
transaction.register_deadline_timer(&self.niri.event_loop);
|
||||||
|
}
|
||||||
|
|
||||||
if was_active {
|
if was_active {
|
||||||
self.maybe_warp_cursor_to_focus();
|
self.maybe_warp_cursor_to_focus();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user