diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-29 21:11:02 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-30 20:12:37 +0300 |
| commit | c5fffd6e2c48aa7fb8b45b8bdcd972bbd8ce900b (patch) | |
| tree | f4bf7c768d21cd72d81da6ca0d1b084631e71276 /src/handlers/compositor.rs | |
| parent | 951f63b6fd48b47ca60e8ed6aa91b4a7b47534f9 (diff) | |
| download | niri-c5fffd6e2c48aa7fb8b45b8bdcd972bbd8ce900b.tar.gz niri-c5fffd6e2c48aa7fb8b45b8bdcd972bbd8ce900b.tar.bz2 niri-c5fffd6e2c48aa7fb8b45b8bdcd972bbd8ce900b.zip | |
Initial WIP floating window implementation
Diffstat (limited to 'src/handlers/compositor.rs')
| -rw-r--r-- | src/handlers/compositor.rs | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/handlers/compositor.rs b/src/handlers/compositor.rs index fe9f8839..0e9397ee 100644 --- a/src/handlers/compositor.rs +++ b/src/handlers/compositor.rs @@ -119,6 +119,11 @@ impl CompositorHandler for State { (ResolvedWindowRules::empty(), None, false, None, None) }; + // The GTK about dialog sets min/max size after the initial configure but + // before mapping, so we need to compute open_floating at the last possible + // moment, that is here. + let is_floating = rules.compute_open_floating(toplevel); + let parent = toplevel .parent() .and_then(|parent| self.niri.layout.find_window_and_output(&parent)) @@ -160,15 +165,20 @@ impl CompositorHandler for State { // // FIXME: do we want to use activate here? How do we want things to behave // exactly? - self.niri - .layout - .add_window_right_of(&p, mapped, width, is_full_width) + self.niri.layout.add_window_right_of( + &p, + mapped, + width, + is_full_width, + is_floating, + ) } else if let Some(workspace_name) = &workspace_name { self.niri.layout.add_window_to_named_workspace( workspace_name, mapped, width, is_full_width, + is_floating, activate, ) } else if let Some(output) = &output { @@ -177,13 +187,18 @@ impl CompositorHandler for State { mapped, width, is_full_width, + is_floating, activate, ); Some(output) } else { - self.niri - .layout - .add_window(mapped, width, is_full_width, activate) + self.niri.layout.add_window( + mapped, + width, + is_full_width, + is_floating, + activate, + ) }; if let Some(output) = output.cloned() { |
