Add WindowBuilder::with_active
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
This commit is contained in:
parent
930df0ec45
commit
b457329003
9 changed files with 60 additions and 5 deletions
|
|
@ -1076,6 +1076,7 @@ where
|
|||
WindowFlags::NO_BACK_BUFFER,
|
||||
pl_attribs.no_redirection_bitmap,
|
||||
);
|
||||
window_flags.set(WindowFlags::MARKER_ACTIVATE, attributes.active);
|
||||
window_flags.set(WindowFlags::TRANSPARENT, attributes.transparent);
|
||||
// WindowFlags::VISIBLE and MAXIMIZED are set down below after the window has been configured.
|
||||
window_flags.set(WindowFlags::RESIZABLE, attributes.resizable);
|
||||
|
|
|
|||
|
|
@ -116,6 +116,8 @@ bitflags! {
|
|||
/// Drop shadow for undecorated windows.
|
||||
const MARKER_UNDECORATED_SHADOW = 1 << 20;
|
||||
|
||||
const MARKER_ACTIVATE = 1 << 18;
|
||||
|
||||
const EXCLUSIVE_FULLSCREEN_OR_MASK = WindowFlags::ALWAYS_ON_TOP.bits;
|
||||
}
|
||||
}
|
||||
|
|
@ -306,8 +308,14 @@ impl WindowFlags {
|
|||
}
|
||||
|
||||
if new.contains(WindowFlags::VISIBLE) {
|
||||
let flag = !if self.contains(WindowFlags::MARKER_ACTIVATE) {
|
||||
self.set(WindowFlags::MARKER_ACTIVATE, true);
|
||||
SWP_NOACTIVATE
|
||||
} else {
|
||||
SW_SHOW
|
||||
};
|
||||
unsafe {
|
||||
ShowWindow(window, SW_SHOW);
|
||||
ShowWindow(window, flag);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue