]> git.saurik.com Git - wxWidgets.git/commitdiff
handling wxSTAY_ON_TOP by changing the window group instead of window class
authorStefan Csomor <csomor@advancedconcepts.ch>
Tue, 28 Dec 2004 10:18:48 +0000 (10:18 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Tue, 28 Dec 2004 10:18:48 +0000 (10:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/toplevel.cpp

index a54c02df217ad617d523ae71fef39b5af13647c9..c689ec094316e65c4a9b7fdd23f41d99a5cde7d8 100644 (file)
@@ -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