diff --git a/src/platform_impl/linux/window.rs b/src/platform_impl/linux/window.rs index 684ed870c..f9a6b9d52 100644 --- a/src/platform_impl/linux/window.rs +++ b/src/platform_impl/linux/window.rs @@ -215,12 +215,11 @@ impl Window { window.set_visible(attributes.visible); window.set_decorated(attributes.decorations); - if attributes.always_on_bottom && attributes.always_on_top { - log::warn!( - "Always on top and always on bottom, are both specified, you should only set one." - ); - } else if attributes.always_on_bottom || attributes.always_on_top { + if attributes.always_on_bottom { window.set_keep_below(attributes.always_on_bottom); + } + + if attributes.always_on_top { window.set_keep_above(attributes.always_on_top); } diff --git a/src/platform_impl/macos/window.rs b/src/platform_impl/macos/window.rs index 0e5b2b776..2c59e5f1a 100644 --- a/src/platform_impl/macos/window.rs +++ b/src/platform_impl/macos/window.rs @@ -232,14 +232,14 @@ fn create_window( ns_window.setMovableByWindowBackground_(YES); } - if attrs.always_on_top && attrs.always_on_bottom { - log::warn!("Always on top and always on bottom, are both specified, you should only set one."); - } else if attrs.always_on_top { + if attrs.always_on_top { let _: () = msg_send![ *ns_window, setLevel: ffi::NSWindowLevel::NSFloatingWindowLevel ]; - } else if attrs.always_on_bottom { + } + + if attrs.always_on_bottom { let _: () = msg_send![ *ns_window, setLevel: ffi::NSWindowLevel::BelowNormalWindowLevel diff --git a/src/platform_impl/windows/window.rs b/src/platform_impl/windows/window.rs index 626ad63b0..3074c3891 100644 --- a/src/platform_impl/windows/window.rs +++ b/src/platform_impl/windows/window.rs @@ -855,6 +855,7 @@ unsafe fn init( let mut window_flags = WindowFlags::empty(); window_flags.set(WindowFlags::DECORATIONS, attributes.decorations); + window_flags.set(WindowFlags::ALWAYS_ON_BOTTOM, attributes.always_on_bottom); window_flags.set(WindowFlags::ALWAYS_ON_TOP, attributes.always_on_top); window_flags.set( WindowFlags::NO_BACK_BUFFER,