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, titlebar: None,
center: false, center: false,
focus: false,
kind: WindowKind::PopUp, kind: WindowKind::PopUp,
is_movable: false, is_movable: false,
screen: Some(screen), screen: Some(screen),

View file

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

View file

@ -152,6 +152,7 @@ pub struct WindowOptions<'a> {
pub bounds: WindowBounds, pub bounds: WindowBounds,
pub titlebar: Option<TitlebarOptions<'a>>, pub titlebar: Option<TitlebarOptions<'a>>,
pub center: bool, pub center: bool,
pub focus: bool,
pub kind: WindowKind, pub kind: WindowKind,
pub is_movable: bool, pub is_movable: bool,
pub screen: Option<Rc<dyn Screen>>, pub screen: Option<Rc<dyn Screen>>,
@ -296,6 +297,7 @@ impl<'a> Default for WindowOptions<'a> {
traffic_light_position: Default::default(), traffic_light_position: Default::default(),
}), }),
center: false, center: false,
focus: true,
kind: WindowKind::Normal, kind: WindowKind::Normal,
is_movable: true, is_movable: true,
screen: None, 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(); window.0.borrow().move_traffic_light();
pool.drain(); pool.drain();

View file

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