mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Implement at-startup window rule
This commit is contained in:
@@ -581,8 +581,11 @@ impl State {
|
||||
};
|
||||
|
||||
let config = self.niri.config.borrow();
|
||||
let rules =
|
||||
ResolvedWindowRules::compute(&config.window_rules, WindowRef::Unmapped(unmapped));
|
||||
let rules = ResolvedWindowRules::compute(
|
||||
&config.window_rules,
|
||||
WindowRef::Unmapped(unmapped),
|
||||
self.niri.is_at_startup,
|
||||
);
|
||||
|
||||
let Unmapped { window, state } = unmapped;
|
||||
|
||||
@@ -876,8 +879,11 @@ impl State {
|
||||
let window_rules = &config.window_rules;
|
||||
|
||||
if let Some(unmapped) = self.niri.unmapped_windows.get_mut(toplevel.wl_surface()) {
|
||||
let new_rules =
|
||||
ResolvedWindowRules::compute(window_rules, WindowRef::Unmapped(unmapped));
|
||||
let new_rules = ResolvedWindowRules::compute(
|
||||
window_rules,
|
||||
WindowRef::Unmapped(unmapped),
|
||||
self.niri.is_at_startup,
|
||||
);
|
||||
if let InitialConfigureState::Configured { rules, .. } = &mut unmapped.state {
|
||||
*rules = new_rules;
|
||||
}
|
||||
@@ -886,7 +892,7 @@ impl State {
|
||||
.layout
|
||||
.find_window_and_output_mut(toplevel.wl_surface())
|
||||
{
|
||||
if mapped.recompute_window_rules(window_rules) {
|
||||
if mapped.recompute_window_rules(window_rules, self.niri.is_at_startup) {
|
||||
drop(config);
|
||||
let output = output.cloned();
|
||||
let window = mapped.window.clone();
|
||||
|
||||
Reference in New Issue
Block a user