Commits

Anonymous committed 4308d7e Merge

CWS-TOOLING: integrate CWS ooo33gsl07

  • Participants
  • Parent commits de54a95, d8dfa7f

Comments (0)

Files changed (7)

extensions/source/plugin/unx/npnapi.cxx

 /*************************************************************************
-
-      Source Code Control System - Header
-
-      $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/extensions/source/plugin/unx/npnapi.cxx,v 1.11 2008-01-14 14:53:25 ihi Exp $
-
-*************************************************************************/
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_extensions.hxx"

extensions/source/plugin/unx/nppapi.cxx

 /*************************************************************************
-
-      Source Code Control System - Header
-
-      $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/extensions/source/plugin/unx/nppapi.cxx,v 1.7 2008-01-14 14:53:38 ihi Exp $
-
-*************************************************************************/
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_extensions.hxx"

vcl/source/gdi/print3.cxx

     // if set, pages are centered and trimmed onto the fixed page
     Size                                                        maFixedPageSize;
     sal_Int32                                                   mnDefaultPaperBin;
+    sal_Int32                                                   mnFixedPaperBin;
     
     ImplPrinterControllerData() :
         mbFirstPage( sal_True ),
         mbReversePageOrder( sal_False ),
         meJobState( view::PrintableState_JOB_STARTED ),
         mpProgress( NULL ),
-        mnDefaultPaperBin( -1 )
+        mnDefaultPaperBin( -1 ),
+        mnFixedPaperBin( -1 )
     {}
     ~ImplPrinterControllerData() { delete mpProgress; }
     
     setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ),
               makeAny( rtl::OUString( i_rPrinter->GetName() ) ) );
     mpImplData->mnDefaultPaperBin = mpImplData->mpPrinter->GetPaperBin();
+    mpImplData->mnFixedPaperBin = -1;
 }
 
 bool PrinterController::setupPrinter( Window* i_pParent )
     bool bRet = false;
     if( mpImplData->mpPrinter.get() )
     {
+        // get old data
         Size aPaperSize( mpImplData->mpPrinter->PixelToLogic(
             mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
+        USHORT nPaperBin = mpImplData->mpPrinter->GetPaperBin();
+
+        // call driver setup
         bRet = mpImplData->mpPrinter->Setup( i_pParent );
         if( bRet )
         {
-            // was the papersize overridden ? if so we need to take action
+            // was papersize or bin  overridden ? if so we need to take action
             Size aNewPaperSize( mpImplData->mpPrinter->PixelToLogic(
                 mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
-            if( aNewPaperSize != aPaperSize )
+            USHORT nNewPaperBin = mpImplData->mpPrinter->GetPaperBin();
+            if( aNewPaperSize != aPaperSize || nNewPaperBin != nPaperBin )
             {
                 mpImplData->maFixedPageSize = aNewPaperSize;
                 mpImplData->maPageCache.invalidate();
                 aOverrideSize.Height = aNewPaperSize.Height();
                 setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OverridePageSize" ) ),
                           makeAny( aOverrideSize ) );
+                mpImplData->mnFixedPaperBin = nNewPaperBin;
             }
         }
     }
     mpImplData->mpPrinter->SetMapMode( MAP_100TH_MM );
 	// aPageSize was filtered through mpImplData->getRealPaperSize already by getFilteredPageFile()
     mpImplData->mpPrinter->SetPaperSizeUser( aPageSize.aSize, ! mpImplData->isFixedPageSize() );
+    if( mpImplData->mnFixedPaperBin != -1 &&
+        mpImplData->mpPrinter->GetPaperBin() != mpImplData->mnFixedPaperBin )
+    {
+        mpImplData->mpPrinter->SetPaperBin( mpImplData->mnFixedPaperBin );
+    }
 
-    // if full paper are is meant, move the output to accomodate for pageoffset
+    // if full paper is meant to be used, move the output to accomodate for pageoffset
     if( aPageSize.bFullPaper )
     {
         Point aPageOffset( mpImplData->mpPrinter->GetPageOffset() );

vcl/unx/gtk/a11y/atkutil.cxx

             // also emit state-changed:focused event under the same condition.
             {
                 AtkObjectWrapper* wrapper_obj = ATK_OBJECT_WRAPPER (atk_obj);
-                if( !wrapper_obj->mpText && wrapper_obj->mpContext )
+                if( wrapper_obj && !wrapper_obj->mpText && wrapper_obj->mpContext )
                 {
                     uno::Any any = wrapper_obj->mpContext->queryInterface( accessibility::XAccessibleText::static_type(NULL) );
                     if ( typelib_TypeClass_INTERFACE == any.pType->eTypeClass &&

vcl/unx/gtk/window/gtkframe.cxx

                 aHints |= GDK_HINT_MAX_SIZE;
             }
         }
-        if( m_bFullscreen )
-        {
-            aGeo.max_width = m_aMaxSize.Width();
-            aGeo.max_height = m_aMaxSize.Height();
-            aHints |= GDK_HINT_MAX_SIZE;
-        }
         if( aHints )
             gtk_window_set_geometry_hints( GTK_WINDOW(m_pWindow),
                                            NULL,
                 // workaround different legacy version window managers have different opinions about
                 // _NET_WM_STATE_FULLSCREEN (Metacity <-> KWin)
                 if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
+                {
+                    if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) )
+                        gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE );
                     gtk_window_fullscreen( GTK_WINDOW( m_pWindow ) );
+                }
                 if( bVisible )
                     Show( TRUE );
             }
         {
             if( bFullScreen )
             {
-                if( getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
-                {
-                    if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) )
-                        gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE );
-                }
+                if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) )
+                    gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE );
                 gtk_window_fullscreen( GTK_WINDOW(m_pWindow) );
                 moveToScreen( nScreen );
                 Size aScreenSize = pDisp->GetScreenSize( m_nScreen ); 
             else
             {
                 gtk_window_unfullscreen( GTK_WINDOW(m_pWindow) );
-                if( getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
-                {
-                    if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) )
-                        gtk_window_set_resizable( GTK_WINDOW(m_pWindow), FALSE );
-                }
+                if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) )
+                    gtk_window_set_resizable( GTK_WINDOW(m_pWindow), FALSE );
                 moveToScreen( nScreen );
             }
         }
     return FALSE;
 }
 
+IMPL_LINK( GtkSalFrame, ImplDelayedFullScreenHdl, void*, EMPTYARG )
+{
+    Atom nStateAtom = getDisplay()->getWMAdaptor()->getAtom(vcl_sal::WMAdaptor::NET_WM_STATE);
+    Atom nFSAtom = getDisplay()->getWMAdaptor()->getAtom(vcl_sal::WMAdaptor::NET_WM_STATE_FULLSCREEN );
+    if( nStateAtom && nFSAtom )
+    {
+        /* #i110881# workaround a gtk issue (see https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8)
+           gtk_window_fullscreen can fail due to a race condition, request an additional status change
+           to fullscreen to be safe
+        */
+        XEvent aEvent;
+        aEvent.type					= ClientMessage;
+        aEvent.xclient.display		= getDisplay()->GetDisplay();
+        aEvent.xclient.window		= GDK_WINDOW_XWINDOW(m_pWindow->window);
+        aEvent.xclient.message_type	= nStateAtom;
+        aEvent.xclient.format		= 32;
+        aEvent.xclient.data.l[0]	= 1;
+        aEvent.xclient.data.l[1]	= nFSAtom;
+        aEvent.xclient.data.l[2]	= 0;
+        aEvent.xclient.data.l[3]	= 0;
+        aEvent.xclient.data.l[4]	= 0;
+        XSendEvent( getDisplay()->GetDisplay(),
+                    getDisplay()->GetRootWindow( m_nScreen ),
+                    False,
+                    SubstructureNotifyMask | SubstructureRedirectMask,
+                    &aEvent
+                    );
+    }
+
+    return 0;
+}
+
 gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame )
 {
     GtkSalFrame* pThis = (GtkSalFrame*)frame;
 
     GTK_YIELD_GRAB();
     
+    if( pThis->m_bFullscreen )
+    {
+        /* #i110881# workaorund a gtk issue (see https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8)
+           gtk_window_fullscreen can run into a race condition with the window's showstate
+        */
+        Application::PostUserEvent( LINK( pThis, GtkSalFrame, ImplDelayedFullScreenHdl ) );
+    }
+    
     bool bSetFocus = pThis->m_bSetFocusOnMap;
     pThis->m_bSetFocusOnMap = false;
     if( ImplGetSVData()->mbIsTestTool )

vcl/unx/inc/plugins/gtk/gtkframe.hxx

 #include <vcl/salframe.hxx>
 #include <vcl/sysdata.hxx>
 
+#include "tools/link.hxx"
+
 #include <list>
 #include <vector>
 
     void setMinMaxSize();
     void createNewWindow( XLIB_Window aParent, bool bXEmbed, int nScreen );
     void askForXEmbedFocus( sal_Int32 nTimecode );
+    
+    DECL_LINK( ImplDelayedFullScreenHdl, void* );
 public:
     GtkSalFrame( SalFrame* pParent, ULONG nStyle );
     GtkSalFrame( SystemParentData* pSysData );

vcl/unx/source/app/wmadaptor.cxx

     if( m_aWMAtoms[ NET_WM_STATE_FULLSCREEN ] )
     {
         pFrame->mbFullScreen = bFullScreen;
+        if( bFullScreen )
+        {
+            if( m_aWMAtoms[ MOTIF_WM_HINTS ] )
+            {
+                XDeleteProperty( m_pDisplay,
+                                 pFrame->GetShellWindow(),
+                                m_aWMAtoms[ MOTIF_WM_HINTS ] );
+            }
+        }
         if( pFrame->bMapped_ )
         {
             // window already mapped, send WM a message