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:
@@ -302,6 +302,8 @@ bool DIALOG_SHIM::Show( bool show )
|
||||
|
||||
m_userPositioned = false;
|
||||
m_userResized = false;
|
||||
|
||||
KIPLATFORM::UI::EnsureVisible( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user