diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-27 09:58:22 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-30 20:12:37 +0300 |
| commit | db6447ed797fc5aa113d49e0da3130abcf58d2cf (patch) | |
| tree | 426cb2aa6ddbc8ac00cb62015608c45e0bb6d95e /src/handlers | |
| parent | 99c0fabee658d3b1fc0fd3faf6741afd344d8dab (diff) | |
| download | niri-db6447ed797fc5aa113d49e0da3130abcf58d2cf.tar.gz niri-db6447ed797fc5aa113d49e0da3130abcf58d2cf.tar.bz2 niri-db6447ed797fc5aa113d49e0da3130abcf58d2cf.zip | |
floating: Support default-column-width in most cases
open-fullscreen + open-floating default width is still not supported in this
commit.
Diffstat (limited to 'src/handlers')
| -rw-r--r-- | src/handlers/compositor.rs | 1 | ||||
| -rw-r--r-- | src/handlers/xdg_shell.rs | 16 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/handlers/compositor.rs b/src/handlers/compositor.rs index c0dc9428..058f8375 100644 --- a/src/handlers/compositor.rs +++ b/src/handlers/compositor.rs @@ -100,6 +100,7 @@ impl CompositorHandler for State { if let InitialConfigureState::Configured { rules, width, + floating_width: _, is_full_width, output, workspace_name, diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs index a3559542..779612b6 100644 --- a/src/handlers/xdg_shell.rs +++ b/src/handlers/xdg_shell.rs @@ -494,6 +494,7 @@ impl XdgShellHandler for State { InitialConfigureState::Configured { rules, width, + floating_width, is_full_width, output, workspace_name, @@ -548,12 +549,14 @@ impl XdgShellHandler for State { state.states.unset(xdg_toplevel::State::Fullscreen); }); - let configure_width = if *is_full_width { + let is_floating = rules.compute_open_floating(&toplevel); + let configure_width = if is_floating { + *floating_width + } else if *is_full_width { Some(ColumnWidth::Proportion(1.)) } else { *width }; - let is_floating = rules.compute_open_floating(&toplevel); ws.configure_new_window( &unmapped.window, configure_width, @@ -836,6 +839,7 @@ impl State { let mon = mon.map(|(mon, _)| mon); let mut width = None; + let mut floating_width = None; let is_full_width = rules.open_maximized.unwrap_or(false); let is_floating = rules.compute_open_floating(toplevel); @@ -859,9 +863,12 @@ impl State { }); } - width = ws.resolve_default_width(rules.default_width, is_floating); + width = ws.resolve_default_width(rules.default_width, false); + floating_width = ws.resolve_default_width(rules.default_width, true); - let configure_width = if is_full_width { + let configure_width = if is_floating { + floating_width + } else if is_full_width { Some(ColumnWidth::Proportion(1.)) } else { width @@ -884,6 +891,7 @@ impl State { *state = InitialConfigureState::Configured { rules, width, + floating_width, is_full_width, output, workspace_name: ws.and_then(|w| w.name().cloned()), |
