Don't focus incoming call and project shared notification windows

This commit is contained in:
Antonio Scandurra 2022-11-02 14:17:16 +01:00
parent 86057ab071
commit d275474b23
5 changed files with 10 additions and 1 deletions

View File

@ -41,6 +41,7 @@ pub fn init(cx: &mut MutableAppContext) {
)),
titlebar: None,
center: false,
focus: false,
kind: WindowKind::PopUp,
is_movable: false,
screen: Some(screen),

View File

@ -40,6 +40,7 @@ pub fn init(cx: &mut MutableAppContext) {
)),
titlebar: None,
center: false,
focus: false,
kind: WindowKind::PopUp,
is_movable: false,
screen: Some(screen),

View File

@ -152,6 +152,7 @@ pub struct WindowOptions<'a> {
pub bounds: WindowBounds,
pub titlebar: Option<TitlebarOptions<'a>>,
pub center: bool,
pub focus: bool,
pub kind: WindowKind,
pub is_movable: bool,
pub screen: Option<Rc<dyn Screen>>,
@ -296,6 +297,7 @@ impl<'a> Default for WindowOptions<'a> {
traffic_light_position: Default::default(),
}),
center: false,
focus: true,
kind: WindowKind::Normal,
is_movable: true,
screen: None,

View File

@ -514,7 +514,11 @@ impl Window {
);
}
}
native_window.makeKeyAndOrderFront_(nil);
if options.focus {
native_window.makeKeyAndOrderFront_(nil);
} else {
native_window.orderFront_(nil);
}
window.0.borrow().move_traffic_light();
pool.drain();

View File

@ -354,6 +354,7 @@ pub fn build_window_options() -> WindowOptions<'static> {
traffic_light_position: Some(vec2f(8., 8.)),
}),
center: false,
focus: true,
kind: WindowKind::Normal,
is_movable: true,
screen: None,