File tree 4 files changed +24
-0
lines changed
src/Uno.UI.Runtime.Skia.MacOS
UnoNativeMac/UnoNativeMac 4 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,18 @@ public override string Title
37
37
set => NativeUno . uno_window_set_title ( _window . Handle , value ) ;
38
38
}
39
39
40
+ public override void Activate ( )
41
+ {
42
+ NativeUno . uno_window_activate ( _window . Handle ) ;
43
+ }
44
+
45
+ protected override void ShowCore ( )
46
+ {
47
+ // the first call to `Window.Activate` does not reach the above `Activate` method
48
+ // https://github.com/unoplatform/uno/blob/fc8e58d77f8cf31d651135c22ea3105099c26fb7/src/Uno.UI/UI/Xaml/Window/Implementations/BaseWindowImplementation.cs#L81-L98
49
+ NativeUno . uno_window_activate ( _window . Handle ) ;
50
+ }
51
+
40
52
private void OnHostSizeChanged ( Size size )
41
53
{
42
54
Bounds = new Rect ( default , size ) ;
Original file line number Diff line number Diff line change @@ -201,6 +201,9 @@ internal static unsafe partial void uno_set_window_events_callbacks(
201
201
[ LibraryImport ( "libUnoNativeMac.dylib" ) ]
202
202
internal static partial nint uno_window_create ( double width , double height ) ;
203
203
204
+ [ LibraryImport ( "libUnoNativeMac.dylib" ) ]
205
+ internal static partial void uno_window_activate ( nint window ) ;
206
+
204
207
[ LibraryImport ( "libUnoNativeMac.dylib" ) ]
205
208
internal static partial void uno_window_invalidate ( nint window ) ;
206
209
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ void uno_set_resize_callback(resize_fn_ptr p);
40
40
NSWindow * uno_app_get_main_window (void );
41
41
42
42
NSWindow * uno_window_create (double width, double height);
43
+ void uno_window_activate (NSWindow *window);
43
44
void uno_window_invalidate (NSWindow *window);
44
45
bool uno_window_resize (NSWindow *window, double width, double height);
45
46
Original file line number Diff line number Diff line change @@ -126,6 +126,14 @@ - (void) applicationDidChangeScreenParametersNotification:(NSNotification*) note
126
126
return window;
127
127
}
128
128
129
+ void uno_window_activate (NSWindow *window)
130
+ {
131
+ #if DEBUG
132
+ NSLog (@" uno_window_activate %@ " , window);
133
+ #endif
134
+ [window orderFront: nil ];
135
+ }
136
+
129
137
void uno_window_notify_screen_change (NSWindow *window)
130
138
{
131
139
assert (windowDidChangeScreen);
You can’t perform that action at this time.
0 commit comments