Ensure dialogs are visible on all Spaces

We never want to hide dialogs if their parent is on a different Space
(MacOS-specific terminology), so set the window property to show
everywhere when showing a dialog

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13906
This commit is contained in:
Seth Hillbrand
2025-08-06 11:48:07 -07:00
parent fa02553d53
commit 7dc83fbffd
5 changed files with 37 additions and 0 deletions
+2
View File
@@ -302,6 +302,8 @@ bool DIALOG_SHIM::Show( bool show )
m_userPositioned = false;
m_userResized = false;
KIPLATFORM::UI::EnsureVisible( this );
}
else
{
+8
View File
@@ -183,6 +183,14 @@ namespace KIPLATFORM
*/
void InfiniteDragReleaseWindow();
/**
* Ensure that a window is visible on the screen. On MacOS, this will make it visible
* in all Spaces. Other platforms are nops.
*
* @param aWindow window to make visible
*/
void EnsureVisible( wxWindow* aWindow );
/**
* Intended to set the floating window level in macOS on a window
*/
+6
View File
@@ -142,6 +142,12 @@ bool KIPLATFORM::UI::IsWindowActive( wxWindow* aWindow )
}
void KIPLATFORM::UI::EnsureVisible( wxWindow* aWindow )
{
// Not needed on this platform
}
void KIPLATFORM::UI::ReparentModal( wxNonOwnedWindow* aWindow )
{
// Not needed on this platform
+6
View File
@@ -76,6 +76,12 @@ bool KIPLATFORM::UI::IsWindowActive( wxWindow* aWindow )
}
void KIPLATFORM::UI::EnsureVisible( wxWindow* aWindow )
{
// Not needed on this platform
}
void KIPLATFORM::UI::ReparentModal( wxNonOwnedWindow* aWindow )
{
// Not needed on this platform
+15
View File
@@ -88,6 +88,21 @@ bool KIPLATFORM::UI::IsWindowActive( wxWindow* aWindow )
}
void KIPLATFORM::UI::EnsureVisible( wxWindow* aWindow )
{
NSView* view = (NSView*)aDialog->GetHandle();
if( view )
{
NSWindow* nsWindow = [view window];
if( nsWindow )
{
[nsWindow setCollectionBehavior:
NSWindowCollectionBehaviorCanJoinAllSpaces];
}
}
}
void KIPLATFORM::UI::ReparentModal( wxNonOwnedWindow* aWindow )
{
wxTopLevelWindow* parent =