handling wxSTAY_ON_TOP by changing the window group instead of window class
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1003,6 +1003,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
|||||||
|
|
||||||
WindowClass wclass = 0;
|
WindowClass wclass = 0;
|
||||||
WindowAttributes attr = kWindowNoAttributes ;
|
WindowAttributes attr = kWindowNoAttributes ;
|
||||||
|
WindowGroupRef group = NULL ;
|
||||||
|
|
||||||
if ( HasFlag( wxFRAME_TOOL_WINDOW) )
|
if ( HasFlag( wxFRAME_TOOL_WINDOW) )
|
||||||
{
|
{
|
||||||
@@ -1074,7 +1075,9 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( HasFlag(wxSTAY_ON_TOP) )
|
if ( HasFlag(wxSTAY_ON_TOP) )
|
||||||
wclass = kUtilityWindowClass;
|
{
|
||||||
|
group = GetWindowGroupOfClass(kUtilityWindowClass) ;
|
||||||
|
}
|
||||||
|
|
||||||
#if TARGET_API_MAC_OSX
|
#if TARGET_API_MAC_OSX
|
||||||
attr |= kWindowCompositingAttribute;
|
attr |= kWindowCompositingAttribute;
|
||||||
@@ -1095,6 +1098,9 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
|||||||
err = ::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ;
|
err = ::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( err == noErr && m_macWindow != NULL && group != NULL )
|
||||||
|
SetWindowGroup( (WindowRef) m_macWindow , group ) ;
|
||||||
|
|
||||||
wxCHECK_RET( err == noErr, wxT("Mac OS error when trying to create new window") );
|
wxCHECK_RET( err == noErr, wxT("Mac OS error when trying to create new window") );
|
||||||
|
|
||||||
// the create commands are only for content rect, so we have to set the size again as
|
// the create commands are only for content rect, so we have to set the size again as
|
||||||
|
Reference in New Issue
Block a user