[ooo-build-commit] .: Branch 'ooo-build-3-2-1' - patches/dev300

Radek Doulík rodo at kemper.freedesktop.org
Wed Aug 11 03:26:50 PDT 2010


 patches/dev300/apply                                 |    4 
 patches/dev300/netbook-window-decoration-update.diff |  314 +++++++++++++++++++
 2 files changed, 318 insertions(+)

New commits:
commit 880e3f17e63f6ad11e6ff99cf713deff589470d1
Author: Radek Doulik <rodo at novell.com>
Date:   Wed Aug 11 12:15:06 2010 +0200

    update netbook small screen code to decorate help window n#621116
    
    * patches/dev300/apply:
    * patches/dev300/netbook-window-decoration-update.diff:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 826a3fc..fd50026 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -4094,3 +4094,7 @@ dde-reconnect-on-load-sfx2.diff, n#618846, n#618864, kohei
 
 # Properly display data field names in the data field options dialog.
 calc-dp-sort-fix.diff, n#629920, kohei
+
+[ Netbook ]
+netbook-window-decoration-update.diff, n#621116, rodo
+
diff --git a/patches/dev300/netbook-window-decoration-update.diff b/patches/dev300/netbook-window-decoration-update.diff
new file mode 100644
index 0000000..45d7813
--- /dev/null
+++ b/patches/dev300/netbook-window-decoration-update.diff
@@ -0,0 +1,314 @@
+diff -rup vcl-orig/inc/vcl/salframe.hxx vcl/inc/vcl/salframe.hxx
+--- vcl-orig/inc/vcl/salframe.hxx	2010-08-09 17:36:47.000000000 +0200
++++ vcl/inc/vcl/salframe.hxx	2010-08-09 17:37:17.000000000 +0200
+@@ -294,7 +294,7 @@ public:
+     long						CallCallback( USHORT nEvent, const void* pEvent ) const
+     { return m_pProc ? m_pProc( m_pWindow, const_cast<SalFrame*>(this), nEvent, pEvent ) : 0; }
+ 
+-    virtual BOOL GetSmallScreenMode() { return FALSE; }
++    virtual BOOL IsInSmallScreenMode() { return FALSE; }
+ };
+ 
+ 
+diff -rup vcl-orig/inc/vcl/salsys.hxx vcl/inc/vcl/salsys.hxx
+--- vcl-orig/inc/vcl/salsys.hxx	2010-08-09 17:36:47.000000000 +0200
++++ vcl/inc/vcl/salsys.hxx	2010-08-09 17:37:17.000000000 +0200
+@@ -66,6 +66,13 @@ public:
+     
+     // get info about the display
+ 
++    /*  Queries whether we are in small screen mode, used on netbooks and
++     *  other small screen devices
++    
++        @returns whether we are in small screen mode
++    */
++    virtual bool IsInSmallScreenMode() { return false; }
++
+     /*  Gets the number of active screens attached to the display
+     
+         @returns the number of active screens
+diff -rup vcl-orig/inc/vcl/svapp.hxx vcl/inc/vcl/svapp.hxx
+--- vcl-orig/inc/vcl/svapp.hxx	2010-08-09 17:36:47.000000000 +0200
++++ vcl/inc/vcl/svapp.hxx	2010-08-09 17:37:17.000000000 +0200
+@@ -369,6 +369,7 @@ public:
+     static void                 SetDisplayName( const UniString& rDisplayName );
+     static UniString            GetDisplayName();
+     
++    static bool                 IsInSmallScreenMode();
+     static unsigned int         GetScreenCount();
+     // IsMultiDisplay returns:
+     //        true:  different screens are separate and windows cannot be moved
+diff -rup vcl-orig/source/app/svapp.cxx vcl/source/app/svapp.cxx
+--- vcl-orig/source/app/svapp.cxx	2010-08-09 17:36:47.000000000 +0200
++++ vcl/source/app/svapp.cxx	2010-08-09 17:37:17.000000000 +0200
+@@ -1363,6 +1363,12 @@ UniString Application::GetDisplayName()
+ 
+ // -----------------------------------------------------------------------
+ 
++bool Application::IsInSmallScreenMode()
++{
++    SalSystem* pSys = ImplGetSalSystem();
++    return pSys ? pSys->IsInSmallScreenMode() : false;
++}
++
+ unsigned int Application::GetScreenCount()
+ {
+     SalSystem* pSys = ImplGetSalSystem();
+diff -rup vcl-orig/unx/gtk/window/gtkframe.cxx vcl/unx/gtk/window/gtkframe.cxx
+--- vcl-orig/unx/gtk/window/gtkframe.cxx	2010-08-09 17:36:47.000000000 +0200
++++ vcl/unx/gtk/window/gtkframe.cxx	2010-08-09 17:41:36.000000000 +0200
+@@ -840,9 +840,6 @@ void GtkSalFrame::Init( SalFrame* pParen
+             eType = GDK_WINDOW_TYPE_HINT_TOOLBAR;
+             gtk_window_set_keep_above( GTK_WINDOW(m_pWindow), true );
+         }
+-        
+-    if( GetSmallScreenMode() && eWinType == GTK_WINDOW_TOPLEVEL && !(nStyle & SAL_FRAME_STYLE_DIALOG ) && !(nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE ) && !(nStyle & SAL_FRAME_STYLE_TOOLWINDOW ) )
+-        bNoDecor = true;
+ 
+         gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), eType );
+         if( bNoDecor )
+@@ -997,6 +994,14 @@ void GtkSalFrame::SetExtendedFrameStyle(
+                                     X11SalData::getFrameResName( m_nExtStyle ),
+                                     X11SalData::getFrameClassName() );
+     }
++    OSL_TRACE("vcl set extended style");
++    if ( ( m_nExtStyle & WB_EXT_DOCUMENT ) && Application::IsInSmallScreenMode() ) {
++        m_nStyle |= SAL_FRAME_STYLE_MOVEABLE | SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_CLOSEABLE ;
++        nStyle |= SAL_FRAME_STYLE_MOVEABLE | SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_CLOSEABLE;
++        gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE );
++        gtk_window_maximize( GTK_WINDOW(m_pWindow) );
++        OSL_TRACE("vcl set extended style: maximized");
++    }
+ }
+ 
+ 
+@@ -1623,9 +1628,6 @@ void GtkSalFrame::SetWindowState( const
+         SAL_FRAMESTATE_MASK_MAXIMIZED_X | SAL_FRAMESTATE_MASK_MAXIMIZED_Y |
+         SAL_FRAMESTATE_MASK_MAXIMIZED_WIDTH | SAL_FRAMESTATE_MASK_MAXIMIZED_HEIGHT;
+     
+-    if( GetSmallScreenMode() && !(m_nStyle & SAL_FRAME_STYLE_DIALOG) && !(m_nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE ) && !(m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW ) )
+-      gtk_window_maximize( GTK_WINDOW(m_pWindow) );
+-    else {
+     if( (pState->mnMask & SAL_FRAMESTATE_MASK_STATE) &&
+         ! ( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) &&
+         (pState->mnState & SAL_FRAMESTATE_MAXIMIZED) &&
+@@ -1673,10 +1675,13 @@ void GtkSalFrame::SetWindowState( const
+     }
+     if( pState->mnMask & SAL_FRAMESTATE_MASK_STATE && ! isChild() )
+     {
+-        if( pState->mnState & SAL_FRAMESTATE_MAXIMIZED )
++        OSL_TRACE("unmaximize?");
++        if( ( pState->mnState & SAL_FRAMESTATE_MAXIMIZED ) || ( ( m_nExtStyle & WB_EXT_DOCUMENT ) && Application::IsInSmallScreenMode() ) )
+             gtk_window_maximize( GTK_WINDOW(m_pWindow) );
+-        else
++        else {
+             gtk_window_unmaximize( GTK_WINDOW(m_pWindow) );
++            OSL_TRACE("unmaximize");
++        }
+         /* #i42379# there is no rollup state in GDK; and rolled up windows are
+         *  (probably depending on the WM) reported as iconified. If we iconify a
+         *  window here that was e.g. a dialog, then it will be unmapped but still
+@@ -1692,7 +1697,6 @@ void GtkSalFrame::SetWindowState( const
+             gtk_window_deiconify( GTK_WINDOW(m_pWindow) );
+     }
+ }
+-}
+ 
+ BOOL GtkSalFrame::GetWindowState( SalFrameState* pState )
+ {
+@@ -3776,7 +3780,7 @@ gboolean GtkSalFrame::IMHandler::signalI
+     return FALSE;
+ }
+ 
+-BOOL GtkSalFrame::GetSmallScreenMode()
++BOOL GtkSalFrame::IsInSmallScreenMode()
+ {
+-    return getDisplay()->getWMAdaptor()->getSmallScreen();
++    return getDisplay()->getWMAdaptor()->isInSmallScreenMode();
+ }
+
+ 
+diff -rup vcl-orig/unx/inc/plugins/gtk/gtkframe.hxx vcl/unx/inc/plugins/gtk/gtkframe.hxx
+--- vcl-orig/unx/inc/plugins/gtk/gtkframe.hxx	2010-08-09 17:36:47.000000000 +0200
++++ vcl/unx/inc/plugins/gtk/gtkframe.hxx	2010-08-09 17:37:17.000000000 +0200
+@@ -394,7 +394,7 @@ public:
+ 
+     static GtkSalFrame         *getFromWindow( GtkWindow *pWindow );
+ 
+-    virtual BOOL GetSmallScreenMode();
++    virtual BOOL IsInSmallScreenMode();
+ };
+ 
+ 
+diff -rup vcl-orig/unx/inc/salsys.h vcl/unx/inc/salsys.h
+--- vcl-orig/unx/inc/salsys.h	2010-08-09 17:36:47.000000000 +0200
++++ vcl/unx/inc/salsys.h	2010-08-09 17:37:17.000000000 +0200
+@@ -48,6 +48,7 @@ public:
+     virtual ~X11SalSystem();
+     
+     // overload pure virtual methods
++	virtual bool IsInSmallScreenMode();
+     virtual unsigned int GetDisplayScreenCount();
+     virtual bool IsMultiDisplay();
+     virtual unsigned int GetDefaultDisplayNumber();
+diff -rup vcl-orig/unx/inc/wmadaptor.hxx vcl/unx/inc/wmadaptor.hxx
+--- vcl-orig/unx/inc/wmadaptor.hxx	2010-08-09 17:36:47.000000000 +0200
++++ vcl/unx/inc/wmadaptor.hxx	2010-08-09 17:37:17.000000000 +0200
+@@ -347,7 +347,7 @@ public:
+      */
+     void changeReferenceFrame( X11SalFrame* pFrame, X11SalFrame* pReferenceFrame ) const;    
+ 
+-    bool getSmallScreen() const { return m_bSmallScreen; }
++    bool isInSmallScreenMode() const { return m_bSmallScreen; }
+ };
+ 
+ } // namespace
+diff -rup vcl-orig/unx/source/app/salsys.cxx vcl/unx/source/app/salsys.cxx
+--- vcl-orig/unx/source/app/salsys.cxx	2010-08-09 17:36:47.000000000 +0200
++++ vcl/unx/source/app/salsys.cxx	2010-08-09 17:37:17.000000000 +0200
+@@ -38,6 +38,7 @@
+ #include <salinst.h>
+ #include <saldisp.hxx>
+ #include <salsys.h>
++#include <wmadaptor.hxx>
+ 
+ #include <rtl/ustrbuf.hxx>
+ #include <osl/thread.h>
+@@ -54,6 +55,11 @@ X11SalSystem::~X11SalSystem()
+ {
+ }
+ 
++bool X11SalSystem::IsInSmallScreenMode()
++{
++    return GetX11SalData()->GetDisplay()->getWMAdaptor()->isInSmallScreenMode();
++}
++
+ // for the moment only handle xinerama case
+ unsigned int X11SalSystem::GetDisplayScreenCount()
+ {
+diff -rup vcl-orig/unx/source/app/wmadaptor.cxx vcl/unx/source/app/wmadaptor.cxx
+--- vcl-orig/unx/source/app/wmadaptor.cxx	2010-08-09 17:36:47.000000000 +0200
++++ vcl/unx/source/app/wmadaptor.cxx	2010-08-09 17:37:17.000000000 +0200
+@@ -234,7 +234,7 @@ WMAdaptor* WMAdaptor::createWMAdaptor( S
+ 
+ WMAdaptor::WMAdaptor( SalDisplay* pDisplay ) :
+         m_pSalDisplay( pDisplay ),
+-    m_bSmallScreen( false ),
++        m_bSmallScreen( false ),
+         m_bTransientBehaviour( true ),
+         m_bEnableAlwaysOnTopWorks( false ),
+         m_bLegacyPartialFullscreen( false ),
+diff -rup framework-orig/inc/services/taskcreatorsrv.hxx framework/inc/services/taskcreatorsrv.hxx
+--- framework-orig/inc/services/taskcreatorsrv.hxx	2010-08-09 17:36:58.000000000 +0200
++++ framework/inc/services/taskcreatorsrv.hxx	2010-08-09 17:37:17.000000000 +0200
+@@ -146,7 +146,8 @@ class TaskCreatorService : public  css::
+ 
+         css::uno::Reference< css::awt::XWindow > implts_createContainerWindow( const css::uno::Reference< css::awt::XWindow >& xParentWindow ,
+                                                                                const css::awt::Rectangle&                      aPosSize      ,
+-                                                                                     sal_Bool                                  bTopWindow    );
++                                                                               sal_Bool                                        bTopWindow    ,
++                                                                               sal_Bool                                        bDocumentWindow );
+     
+         void implts_applyDocStyleToWindow(const css::uno::Reference< css::awt::XWindow >& xWindow) const;
+     
+diff -rup framework-orig/source/services/taskcreatorsrv.cxx framework/source/services/taskcreatorsrv.cxx
+--- framework-orig/source/services/taskcreatorsrv.cxx	2010-08-09 17:36:59.000000000 +0200
++++ framework/source/services/taskcreatorsrv.cxx	2010-08-09 17:38:58.000000000 +0200
+@@ -139,6 +140,7 @@ css::uno::Reference< css::uno::XInterfac
+     static css::awt::Rectangle DEFAULTVAL_POSSIZE                       = css::awt::Rectangle(0, 0, 0, 0); // only possize=[0,0,0,0] triggers default handling of vcl !
+     static sal_Bool            DEFAULTVAL_SUPPORTPERSSISTENTWINDOWSTATE = sal_False;
+     static sal_Bool            DEFAULTVAL_ENABLE_TITLEBARUPDATE         = sal_True;
++    sal_Bool bDocumentWindow = sal_False;
+ 
+     ::comphelper::SequenceAsHashMap lArgs(lArguments);
+ 
+@@ -151,6 +153,9 @@ css::uno::Reference< css::uno::XInterfac
+     sal_Bool                                  bSupportPersistentWindowState = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE , DEFAULTVAL_SUPPORTPERSSISTENTWINDOWSTATE   );
+     sal_Bool                                  bEnableTitleBarUpdate         = lArgs.getUnpackedValueOrDefault(TaskCreatorService::ARGUMENT_ENABLE_TITLEBARUPDATE        , DEFAULTVAL_ENABLE_TITLEBARUPDATE           );
+ 
++    if (sFrameName.compareToAscii( "_blank") == 0)
++        bDocumentWindow = sal_True;
++
+     /* SAFE { */
+     ReadGuard aReadLock( m_aLock );
+     css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+@@ -173,7 +178,7 @@ css::uno::Reference< css::uno::XInterfac
+         if ( ! xParentWindow.is())
+             bCreateTopWindow = sal_True;
+ 
+-        xContainerWindow = implts_createContainerWindow(xParentWindow, aPosSize, bCreateTopWindow);
++        xContainerWindow = implts_createContainerWindow(xParentWindow, aPosSize, bCreateTopWindow, bDocumentWindow);
+     }
+     
+     //------------------->
+@@ -190,8 +195,9 @@ css::uno::Reference< css::uno::XInterfac
+                                                 (  xDesktop.is()     )
+                                             )
+                                          );
+-    if (bTopLevelDocumentWindow)
++    if (bTopLevelDocumentWindow) {
+         implts_applyDocStyleToWindow(xContainerWindow);
++    }
+     //------------------->
+ 
+     // create the new frame
+@@ -239,7 +254,8 @@ void TaskCreatorService::implts_applyDoc
+ //-----------------------------------------------
+ css::uno::Reference< css::awt::XWindow > TaskCreatorService::implts_createContainerWindow( const css::uno::Reference< css::awt::XWindow >& xParentWindow ,
+                                                                                            const css::awt::Rectangle&                      aPosSize      ,
+-                                                                                                 sal_Bool                                  bTopWindow    )
++                                                                                           sal_Bool                                        bTopWindow,
++                                                                                           sal_Bool                                        bDocumentWindow )
+ {
+     // SAFE  ->
+     ReadGuard aReadLock( m_aLock );
+@@ -274,6 +290,9 @@ css::uno::Reference< css::awt::XWindow >
+                                             css::awt::WindowAttribute::SIZEABLE             |
+                                             css::awt::WindowAttribute::CLOSEABLE            |
+                                             css::awt::VclWindowPeerAttribute::CLIPCHILDREN  ;
++        OSL_TRACE("style, ssm: %d doc: %d", Application::IsInSmallScreenMode(), bDocumentWindow);
++        if (bDocumentWindow && Application::IsInSmallScreenMode() )
++            aDescriptor.WindowAttributes |= css::awt::WindowAttribute::NODECORATION;
+     }
+     else
+     {
+diff -rup toolkit-orig/source/awt/vclxtoolkit.cxx toolkit/source/awt/vclxtoolkit.cxx
+--- toolkit-orig/source/awt/vclxtoolkit.cxx	2010-08-09 17:37:07.000000000 +0200
++++ toolkit/source/awt/vclxtoolkit.cxx	2010-08-09 17:37:17.000000000 +0200
+@@ -241,18 +241,15 @@ TOOLKIT_DLLPUBLIC WinBits ImplGetWinBits
+     }
+ 
+ 
+-    if ( bDecoratedWindow )
++    if( nComponentAttribs & ::com::sun::star::awt::WindowAttribute::NODECORATION )
+     {
+-        if( nComponentAttribs & ::com::sun::star::awt::WindowAttribute::NODECORATION )
+-        {
+-            // No decoration removes several window attributes and must
+-            // set WB_NOBORDER!
+-            nWinBits &= ~WB_BORDER;
+-            nWinBits &= ~WB_SIZEABLE;
+-            nWinBits &= ~WB_MOVEABLE;
+-            nWinBits &= ~WB_CLOSEABLE;
+-            nWinBits |= WB_NOBORDER;
+-        }
++        // No decoration removes several window attributes and must
++        // set WB_NOBORDER!
++        nWinBits &= ~WB_BORDER;
++        nWinBits &= ~WB_SIZEABLE;
++        nWinBits &= ~WB_MOVEABLE;
++        nWinBits &= ~WB_CLOSEABLE;
++        nWinBits |= WB_NOBORDER;
+     }
+ 
+     return nWinBits;
+diff -rup vcl-orig-1/source/window/window3.cxx vcl/source/window/window3.cxx
+--- vcl-orig-1/source/window/window3.cxx	2010-08-09 18:30:04.000000000 +0200
++++ vcl/source/window/window3.cxx	2010-08-09 18:30:45.000000000 +0200
+@@ -84,5 +84,5 @@ void Window::ImplAdjustNWFSizes()
+ 
+ BOOL Window::GetSmallScreenMode()
+ {
+-    return ImplGetFrame()->GetSmallScreenMode();
++    return ImplGetFrame()->IsInSmallScreenMode();
+ }


More information about the ooo-build-commit mailing list