Activate newly mapped windows with a valid activation token

most of the time the activation token is passed
while the window is still unmapped. in this case
store the intend to activate the window for
later retrieval on map.
This commit is contained in:
Christian Meissl
2024-11-16 22:35:34 +01:00
committed by Ivan Molodetskikh
parent 61f2ac01d7
commit 305fc3b557
6 changed files with 120 additions and 42 deletions
+3 -2
View File
@@ -3,7 +3,7 @@ use std::time::Duration;
use niri::animation::Clock;
use niri::layout::workspace::ColumnWidth;
use niri::layout::{LayoutElement as _, Options};
use niri::layout::{ActivateWindow, LayoutElement as _, Options};
use niri::render_helpers::RenderTarget;
use niri_config::{Color, FloatOrInt, OutputName};
use smithay::backend::renderer::element::RenderElement;
@@ -162,7 +162,8 @@ impl Layout {
window.request_size(ws.new_window_size(width, window.rules()), false, None);
window.communicate();
self.layout.add_window(window.clone(), width, false);
self.layout
.add_window(window.clone(), width, false, ActivateWindow::default());
self.windows.push(window);
}