Commits

Anonymous committed 01ace29

CWS-TOOLING: integrate CWS ooo31gsl5_DEV300
2009-03-12 11:47:20 +0100 cd r269379 : #i100110# Reset deleted flag in Execute_Impl to prevent dtor to write to stack
2009-03-11 18:03:43 +0100 pl r269346 : #i100116# fix accept focus behavior of tool windows (thanks cmc)

  • Participants
  • Parent commits 0c0b06a

Comments (0)

Files changed (2)

File sfx2/source/dialog/templdlg.cxx

 		nId, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD | SFX_CALLMODE_MODAL,
 		pItems, nModi );
 
+    // FIXME: Dialog can be destroyed while in Execute() check stack variable for dtor flag!
     if ( !pItem || aDeleted() )
-		return FALSE;
+        return FALSE;
 
 	if ( nId == SID_STYLE_NEW || SID_STYLE_EDIT == nId )
 	{
 				*pIdx = i;
 		}
 	}
-	return TRUE;
+    
+    // Reset destroyed flag otherwise we use the pointer in the dtor
+    // where the local stack object is already destroyed. This would
+    // overwrite objects on the stack!! See #i100110
+    pbDeleted = NULL;
+    return TRUE;
 }
 
 //-------------------------------------------------------------------------

File vcl/unx/gtk/window/gtkframe.cxx

         ( ! (nStyle & SAL_FRAME_STYLE_FLOAT) ||
           (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) );
 
+    /* #i100116# metacity has a peculiar behavior regarding WM_HINT accept focus and _NET_WM_USER_TIME
+        at some point that may be fixed in metacity and we will have to revisit this
+    */
+    bool bMetaCityToolWindowHack = getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("Metacity") &&
+                                   (nStyle & SAL_FRAME_STYLE_TOOLWINDOW );
     if( bDecoHandling )
     {
         bool bNoDecor = ! (nStyle & (SAL_FRAME_STYLE_MOVEABLE | SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_CLOSEABLE ) );
         {
             eType = GDK_WINDOW_TYPE_HINT_UTILITY;
             gtk_window_set_skip_taskbar_hint( GTK_WINDOW(m_pWindow), true );
-            lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, true );
+            if( bMetaCityToolWindowHack )
+                lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, true );
         }
         else if( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) )
         {
     if( bDecoHandling )
     {
         gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) ? TRUE : FALSE );
-        if( ( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) || ( (nStyle & SAL_FRAME_STYLE_TOOLWINDOW ) ) )
+        if( ( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) || bMetaCityToolWindowHack )
             lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, false );
     }
     
             if( nUserTime == 0 && 
                (
                  getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("Metacity") ||
-                 getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("compiz")
+                 (
+                    getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("compiz") &&
+                    (m_nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION))
+                 )
                )
               )
             {