File tree 1 file changed +13
-9
lines changed
1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ public sealed partial class MainWindow : WinUIEx.WindowEx
20
20
21
21
public nint WindowHandle { get ; }
22
22
private bool CanWindowToFront { get ; set ; } = true ;
23
+ private readonly object _canWindowToFrontLock = new ( ) ;
23
24
24
25
public MainWindow ( )
25
26
{
@@ -343,15 +344,18 @@ x.tabItem.NavigationParameter.NavigationParameter is PaneNavigationArguments pan
343
344
}
344
345
}
345
346
346
- public bool SetCanWindowToFront ( bool canWindowToFront )
347
- {
348
- if ( CanWindowToFront != canWindowToFront )
349
- {
350
- CanWindowToFront = canWindowToFront ;
351
- return true ;
352
- }
353
- return false ;
354
- }
347
+ public bool SetCanWindowToFront ( bool canWindowToFront )
348
+ {
349
+ lock ( _canWindowToFrontLock )
350
+ {
351
+ if ( CanWindowToFront != canWindowToFront )
352
+ {
353
+ CanWindowToFront = canWindowToFront ;
354
+ return true ;
355
+ }
356
+ return false ;
357
+ }
358
+ }
355
359
356
360
private const int WM_WINDOWPOSCHANGING = 0x0046 ;
357
361
private void WindowManager_WindowMessageReceived ( object ? sender , WinUIEx . Messaging . WindowMessageEventArgs e )
You can’t perform that action at this time.
0 commit comments