File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 11# Unreleased
22
3+ - On macOS, wait with activating the application until the application has initialized.
34- On macOS, fix creating new windows when the application has a main menu.
45- On Windows, fix fractional deltas for mouse wheel device events.
56- On macOS, fix segmentation fault after dropping the main window.
Original file line number Diff line number Diff line change @@ -13,10 +13,11 @@ use std::{
1313} ;
1414
1515use cocoa:: {
16- appkit:: { NSApp , NSWindow } ,
16+ appkit:: { NSApp , NSApplication , NSWindow } ,
1717 base:: { id, nil} ,
1818 foundation:: { NSAutoreleasePool , NSSize } ,
1919} ;
20+ use objc:: runtime:: YES ;
2021
2122use crate :: {
2223 dpi:: LogicalSize ,
@@ -272,6 +273,11 @@ impl AppState {
272273 }
273274
274275 pub fn launched ( ) {
276+ unsafe {
277+ let ns_app = NSApp ( ) ;
278+ // TODO: Consider allowing the user to specify they don't want their application activated
279+ ns_app. activateIgnoringOtherApps_ ( YES ) ;
280+ } ;
275281 HANDLER . set_ready ( ) ;
276282 HANDLER . waker ( ) . start ( ) ;
277283 HANDLER . set_in_callback ( true ) ;
Original file line number Diff line number Diff line change @@ -361,7 +361,7 @@ impl UnownedWindow {
361361
362362 let pool = unsafe { NSAutoreleasePool :: new ( nil) } ;
363363
364- let ns_app = create_app ( pl_attribs. activation_policy ) . ok_or_else ( || {
364+ create_app ( pl_attribs. activation_policy ) . ok_or_else ( || {
365365 unsafe { pool. drain ( ) } ;
366366 os_error ! ( OsError :: CreationError ( "Couldn't create `NSApplication`" ) )
367367 } ) ?;
@@ -387,7 +387,6 @@ impl UnownedWindow {
387387 ns_window. setBackgroundColor_ ( NSColor :: clearColor ( nil) ) ;
388388 }
389389
390- ns_app. activateIgnoringOtherApps_ ( YES ) ;
391390 win_attribs. min_inner_size . map ( |dim| {
392391 let logical_dim = dim. to_logical ( scale_factor) ;
393392 set_min_inner_size ( * ns_window, logical_dim)
You can’t perform that action at this time.
0 commit comments