File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/Windows/Avalonia.Win32 Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -708,6 +708,8 @@ public void SetParent(IWindowImpl? parent)
708
708
_hiddenWindowIsParent = parentHwnd == OffscreenParentWindow . Handle ;
709
709
710
710
SetWindowLongPtr ( _hwnd , ( int ) WindowLongParam . GWL_HWNDPARENT , parentHwnd ) ;
711
+
712
+ ( parent as WindowImpl ) ? . EnsureTopmost ( ) ;
711
713
}
712
714
713
715
public void SetEnabled ( bool enable ) => EnableWindow ( _hwnd , enable ) ;
@@ -860,6 +862,17 @@ public void SetTopmost(bool value)
860
862
_topmost = value ;
861
863
}
862
864
865
+ private void EnsureTopmost ( )
866
+ {
867
+ if ( _topmost )
868
+ {
869
+ SetWindowPos ( _hwnd ,
870
+ WindowPosZOrder . HWND_TOPMOST ,
871
+ 0 , 0 , 0 , 0 ,
872
+ SetWindowPosFlags . SWP_NOMOVE | SetWindowPosFlags . SWP_NOSIZE | SetWindowPosFlags . SWP_NOACTIVATE ) ;
873
+ }
874
+ }
875
+
863
876
public unsafe void SetFrameThemeVariant ( PlatformThemeVariant themeVariant )
864
877
{
865
878
_currentThemeVariant = themeVariant ;
You can’t perform that action at this time.
0 commit comments