From: Stefan Csomor Date: Tue, 28 Dec 2004 10:18:48 +0000 (+0000) Subject: handling wxSTAY_ON_TOP by changing the window group instead of window class X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e353795ec51caac9f0d1756bad5a8706a5c8c8d1 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 --- diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index a54c02df21..c689ec0943 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -1003,6 +1003,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title, WindowClass wclass = 0; WindowAttributes attr = kWindowNoAttributes ; + WindowGroupRef group = NULL ; if ( HasFlag( wxFRAME_TOOL_WINDOW) ) { @@ -1073,8 +1074,10 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title, attr |= kWindowLiveResizeAttribute; } - if (HasFlag(wxSTAY_ON_TOP)) - wclass = kUtilityWindowClass; + if ( HasFlag(wxSTAY_ON_TOP) ) + { + group = GetWindowGroupOfClass(kUtilityWindowClass) ; + } #if TARGET_API_MAC_OSX attr |= kWindowCompositingAttribute; @@ -1095,6 +1098,9 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title, 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") ); // the create commands are only for content rect, so we have to set the size again as