mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-25 01:58:51 +02:00
fix(wm): change when floating windows are centered
This commit changes the behaviour of when floating windows are centered by making them only center when we are on a `WorkspaceLayer::Floating` and the window doesn't match a `floating_windows` rule and the workspace is not a floating workspace.
This commit is contained in:
@@ -395,10 +395,19 @@ impl WindowManager {
|
|||||||
&& !matches!(event, WindowManagerEvent::Manage(_)));
|
&& !matches!(event, WindowManagerEvent::Manage(_)));
|
||||||
|
|
||||||
if behaviour.float_override {
|
if behaviour.float_override {
|
||||||
|
// Center floating windows if we are already on the `Floating`
|
||||||
|
// layer and the window doesn't match a `floating_windows` rule and
|
||||||
|
// the workspace is not a floating workspace
|
||||||
|
let center_spawned_floats =
|
||||||
|
matches!(workspace.layer, WorkspaceLayer::Floating)
|
||||||
|
&& !should_float
|
||||||
|
&& workspace.tile;
|
||||||
workspace.floating_windows_mut().push(window);
|
workspace.floating_windows_mut().push(window);
|
||||||
workspace.set_layer(WorkspaceLayer::Floating);
|
workspace.set_layer(WorkspaceLayer::Floating);
|
||||||
let mut floating_window = window;
|
if center_spawned_floats {
|
||||||
floating_window.center(&workspace.globals().work_area)?;
|
let mut floating_window = window;
|
||||||
|
floating_window.center(&workspace.globals().work_area)?;
|
||||||
|
}
|
||||||
self.update_focused_workspace(false, false)?;
|
self.update_focused_workspace(false, false)?;
|
||||||
} else {
|
} else {
|
||||||
match behaviour.current_behaviour {
|
match behaviour.current_behaviour {
|
||||||
|
|||||||
Reference in New Issue
Block a user