Skip to content

Commit

Permalink
refactor: remove unnecessary warning
Browse files Browse the repository at this point in the history
Co-Authored-By: Amr Bashir <[email protected]>
  • Loading branch information
henry40408 and amrbashir committed Aug 21, 2022
1 parent 3f4feba commit a563d89
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
9 changes: 4 additions & 5 deletions src/platform_impl/linux/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
8 changes: 4 additions & 4 deletions src/platform_impl/macos/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/platform_impl/windows/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,7 @@ unsafe fn init<T: 'static>(

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,
Expand Down

0 comments on commit a563d89

Please sign in to comment.