[ooo-build-commit] .: 4 commits - svtools/inc vcl/unx

Caolán McNamara caolan at kemper.freedesktop.org
Thu Oct 7 05:46:49 PDT 2010


 svtools/inc/svtools/svtools.hrc          |    1 +
 vcl/unx/gtk/app/gtkdata.cxx              |   29 ++++++++++++++++++++++++++++-
 vcl/unx/gtk/window/gtkframe.cxx          |    9 ++-------
 vcl/unx/inc/plugins/gtk/gtkdata.hxx      |    2 ++
 vcl/unx/inc/saldisp.hxx                  |    4 +++-
 vcl/unx/source/app/saldisp.cxx           |    8 +++++---
 vcl/unx/source/app/salsys.cxx            |    2 +-
 vcl/unx/source/fontmanager/fontcache.cxx |    4 ++--
 8 files changed, 44 insertions(+), 15 deletions(-)

New commits:
commit cf1fbd62efb8dd3c20529b41ebae49c1e52558f5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 7 12:55:46 2010 +0100

    #i113141# show all appropiate formats by default on save as

diff --git a/svtools/inc/svtools/svtools.hrc b/svtools/inc/svtools/svtools.hrc
index 3d8010b..d6e679a 100644
--- a/svtools/inc/svtools/svtools.hrc
+++ b/svtools/inc/svtools/svtools.hrc
@@ -73,6 +73,7 @@
 #define RID_FILEOPEN_INVALIDFOLDER		(RID_SVTOOLS_START + 34)
 #define RID_FILEOPEN_NOTEXISTENTFILE	(RID_SVTOOLS_START + 35)
 #define STR_SVT_NOREMOVABLEDEVICE       (RID_SVTOOLS_START + 36)
+#define STR_SVT_ALLFORMATS				(RID_SVTOOLS_START + 37)
 
 // doc template dialog
 #define DLG_DOCTEMPLATE					(RID_SVTOOLS_START+50)
commit dbbfe692dfbde95f0a21997dd8f88fd009286964
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 7 12:41:22 2010 +0100

    i#112421# make Presenter Screen default to the laptop, not projector
    
    Do the right thing, and make Presenter Screen default to displaying on the
    laptop, not the projector via gdk_screen_get_primary_monitor where
    available, falling back to a similar impl if not

diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index fd08974..10b1c43 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -217,11 +217,12 @@ void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen )
             {
                 gint nMonitors = gdk_screen_get_n_monitors(pScreen);
                 m_aXineramaScreens = std::vector<Rectangle>();
+                m_aXineramaScreenIndexMap = std::vector<int>(nMonitors);
                 for (gint i = 0; i < nMonitors; ++i)
                 {
                     GdkRectangle dest;
                     gdk_screen_get_monitor_geometry(pScreen, i, &dest);
-                    addXineramaScreenUnique( dest.x, dest.y, dest.width, dest.height );
+                    addXineramaScreenUnique( i, dest.x, dest.y, dest.width, dest.height );
                 }
                 m_bXinerama = m_aXineramaScreens.size() > 1;
                 if( ! m_aFrames.empty() )
@@ -235,6 +236,32 @@ void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen )
     }
 }
 
+extern "C"
+{
+    typedef gint(* screen_get_primary_monitor)(GdkScreen *screen);
+}
+
+int GtkSalDisplay::GetDefaultMonitorNumber() const
+{
+    GdkScreen* pScreen = gdk_display_get_screen( m_pGdkDisplay, m_nDefaultScreen );
+#if GTK_CHECK_VERSION(2,20,0)
+    return m_aXineramaScreenIndexMap[gdk_screen_get_primary_monitor(pScreen)];
+#else
+    static screen_get_primary_monitor sym_gdk_screen_get_primary_monitor =
+        (screen_get_primary_monitor)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_primary_monitor" );
+    if (sym_gdk_screen_get_primary_monitor)
+        return sym_gdk_screen_get_primary_monitor( pScreen );
+    //gdk_screen_get_primary_monitor unavailable, take the first laptop monitor as the default
+    gint nMonitors = gdk_screen_get_n_monitors(pScreen);
+    for (gint i = 0; i < nMonitors; ++i)
+    {
+        if (g_ascii_strncasecmp (gdk_screen_get_monitor_plug_name(pScreen, i), "LVDS", 4) == 0)
+            return m_aXineramaScreenIndexMap[i];
+    }
+    return 0;
+#endif
+}
+
 void GtkSalDisplay::initScreen( int nScreen ) const
 {
     if( nScreen < 0 || nScreen >= static_cast<int>(m_aScreens.size()) )
diff --git a/vcl/unx/inc/plugins/gtk/gtkdata.hxx b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
index 3ce837c..118b7da 100644
--- a/vcl/unx/inc/plugins/gtk/gtkdata.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
@@ -73,6 +73,8 @@ public:
     virtual long Dispatch( XEvent *pEvent );
     virtual void initScreen( int nScreen ) const;
 
+    virtual int GetDefaultMonitorNumber() const;
+
     static GdkFilterReturn filterGdkEvent( GdkXEvent* sys_event,
                                            GdkEvent* event,
                                            gpointer data );
diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx
index 313785d..99d1a16 100644
--- a/vcl/unx/inc/saldisp.hxx
+++ b/vcl/unx/inc/saldisp.hxx
@@ -386,6 +386,7 @@ protected:
 
     bool			m_bXinerama;
     std::vector< Rectangle > m_aXineramaScreens;
+    std::vector< int > m_aXineramaScreenIndexMap;
     std::list<SalFrame*> m_aFrames;
     std::list<SalObject*> m_aSalObjects;
     
@@ -401,7 +402,7 @@ protected:
     int             processRandREvent( XEvent* );
 
     void			doDestruct();
-    void            addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, long i_nHeight );
+    void            addXineramaScreenUnique( int i, long i_nX, long i_nY, long i_nWidth, long i_nHeight );
 public:
     static	SalDisplay	   *GetSalDisplay( Display* display );
     static	BOOL			BestVisual( Display     *pDisp,
@@ -473,6 +474,7 @@ public:
     XLIB_Window		GetDrawable( int nScreen ) const { return getDataForScreen( nScreen ).m_aRefWindow; }
     Display		   *GetDisplay() const { return pDisp_; }
     int				GetDefaultScreenNumber() const { return m_nDefaultScreen; }
+    virtual int     GetDefaultMonitorNumber() const { return 0; }
     const Size&     GetScreenSize( int nScreen ) const { return getDataForScreen( nScreen ).m_aSize; }
     srv_vendor_t	GetServerVendor() const { return meServerVendor; }
     void			SetServerVendor() { meServerVendor = sal_GetServerVendor(pDisp_); }
diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx
index 50a37f9..2742bfa 100644
--- a/vcl/unx/source/app/saldisp.cxx
+++ b/vcl/unx/source/app/saldisp.cxx
@@ -2682,7 +2682,7 @@ void SalDisplay::PrintInfo() const
              sal::static_int_cast< unsigned int >(GetVisual(m_nDefaultScreen).GetVisualId()) );
 }
 
-void SalDisplay::addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, long i_nHeight )
+void SalDisplay::addXineramaScreenUnique( int i, long i_nX, long i_nY, long i_nWidth, long i_nHeight )
 {
     // see if any frame buffers are at the same coordinates
     // this can happen with weird configuration e.g. on
@@ -2696,11 +2696,13 @@ void SalDisplay::addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, l
             if( m_aXineramaScreens[n].GetWidth() < i_nWidth ||
                 m_aXineramaScreens[n].GetHeight() < i_nHeight )
             {
+                m_aXineramaScreenIndexMap[i] = n;
                 m_aXineramaScreens[n].SetSize( Size( i_nWidth, i_nHeight ) );
             }
             return;
         }
     }
+    m_aXineramaScreenIndexMap[i] = m_aXineramaScreens.size();
     m_aXineramaScreens.push_back( Rectangle( Point( i_nX, i_nY ), Size( i_nWidth, i_nHeight ) ) );
 }
 
@@ -2728,7 +2730,7 @@ void SalDisplay::InitXinerama()
             m_bXinerama = true;
             m_aXineramaScreens = std::vector<Rectangle>();
             for( int i = 0; i < nFramebuffers; i++ )
-                addXineramaScreenUnique( pFramebuffers[i].x,
+                addXineramaScreenUnique( i, pFramebuffers[i].x,
                                          pFramebuffers[i].y,
                                          pFramebuffers[i].width,
                                          pFramebuffers[i].height );
@@ -2746,7 +2748,7 @@ if( XineramaIsActive( pDisp_ ) )
             m_aXineramaScreens = std::vector<Rectangle>();
             for( int i = 0; i < nFramebuffers; i++ )
             {
-                addXineramaScreenUnique( pScreens[i].x_org,
+                addXineramaScreenUnique( i, pScreens[i].x_org,
                                          pScreens[i].y_org,
                                          pScreens[i].width,
                                          pScreens[i].height );
diff --git a/vcl/unx/source/app/salsys.cxx b/vcl/unx/source/app/salsys.cxx
index 82bf2ec..93a327c 100644
--- a/vcl/unx/source/app/salsys.cxx
+++ b/vcl/unx/source/app/salsys.cxx
@@ -71,7 +71,7 @@ bool X11SalSystem::IsMultiDisplay()
 unsigned int X11SalSystem::GetDefaultDisplayNumber()
 {
     SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
-    return pSalDisp->GetDefaultScreenNumber();
+    return pSalDisp->IsXinerama() ? pSalDisp->GetDefaultMonitorNumber() : pSalDisp->GetDefaultScreenNumber();
 }
 
 Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
commit 233d37cdeab78e501c396d29a2abad6ad3dcc4ad
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 7 12:11:18 2010 +0100

    #i114702# fix an off by one

diff --git a/vcl/unx/source/fontmanager/fontcache.cxx b/vcl/unx/source/fontmanager/fontcache.cxx
index cbce731..0180820 100644
--- a/vcl/unx/source/fontmanager/fontcache.cxx
+++ b/vcl/unx/source/fontmanager/fontcache.cxx
@@ -373,9 +373,9 @@ void FontCache::read()
                     xub_StrLen nLastIndex = nIndex+1;
                     for( nIndex = nLastIndex ; nIndex < nLen && pLine[nIndex] != ';'; nIndex++ )
                         ;
-                    if( nIndex - nLastIndex > 1 )
+                    if( nIndex - nLastIndex )
                     {
-                        OUString aAlias( pLine+nLastIndex, nIndex-nLastIndex-1, RTL_TEXTENCODING_UTF8 );
+                        OUString aAlias( pLine+nLastIndex, nIndex-nLastIndex, RTL_TEXTENCODING_UTF8 );
                         pFont->m_aAliases.push_back( pAtoms->getAtom( ATOM_FAMILYNAME, aAlias, sal_True ) );
                     }
                 }
commit 709846db310f407ded29084af35fa7463c1328b1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 7 12:02:55 2010 +0100

    #i113856# sync the window manager fix

diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 27b63bd..8cd3cb1 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1356,12 +1356,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
             //
             // i.e. having a time < that of the toplevel frame means that the toplevel frame gets unfocused.
             // awesome.
-            bool bHack =
-                getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("Metacity") ||
-                getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("compiz") ||
-                getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("Mutter")
-                ;
-            if( nUserTime == 0 && bHack )
+            if( nUserTime == 0 )
             {
                 /* #i99360# ugly workaround an X11 library bug */
                 nUserTime= getDisplay()->GetLastUserEventTime( true );
@@ -1369,7 +1364,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
             }
             lcl_set_user_time( GTK_WIDGET(m_pWindow)->window, nUserTime );
             
-            if( bHack && ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) )
+            if( ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) )
                 m_bSetFocusOnMap = true;
 
             gtk_widget_show( m_pWindow );


More information about the ooo-build-commit mailing list