[Libreoffice-commits] .: 2 commits - vcl/unx
Caolán McNamara
caolan at kemper.freedesktop.org
Mon Oct 10 09:09:24 PDT 2011
vcl/unx/gtk/app/gtkdata.cxx | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
New commits:
commit 76a0e6ee30cb7610bc0eb1d536476fc801f3a3bf
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Oct 10 17:09:12 2011 +0100
grab monitors on start also
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 4e10809..904d22a 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -783,6 +783,9 @@ void GtkXLib::Init()
GdkScreen *pScreen = gdk_display_get_screen( pGdkDisp, n );
if( pScreen )
{
+ m_pGtkSalDisplay->screenSizeChanged(pScreen);
+ m_pGtkSalDisplay->monitorsChanged(pScreen);
+
g_signal_connect( G_OBJECT(pScreen), "size-changed", G_CALLBACK(signalScreenSizeChanged), m_pGtkSalDisplay );
if( ! gtk_check_version( 2, 14, 0 ) ) // monitors-changed came in with 2.14, avoid an assertion
g_signal_connect( G_OBJECT(pScreen), "monitors-changed", G_CALLBACK(signalMonitorsChanged), m_pGtkSalDisplay );
commit 1f88a2a00dfdcc29e805d23c1a88a82b69d59d24
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Oct 10 17:08:37 2011 +0100
fix the fallback logic
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 4cb161a..4e10809 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -259,20 +259,24 @@ int GtkSalDisplay::GetDefaultMonitorNumber() const
(screen_get_primary_monitor)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_primary_monitor" );
if (sym_gdk_screen_get_primary_monitor)
n = sym_gdk_screen_get_primary_monitor( pScreen );
-#if GTK_CHECK_VERSION(2,14,0)
- //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)
+ else
{
- if (g_ascii_strncasecmp (gdk_screen_get_monitor_plug_name(pScreen, i), "LVDS", 4) == 0) {
- OSL_ASSERT( size_t(i) < m_aXineramaScreenIndexMap.size() );
- return (size_t(i) < m_aXineramaScreenIndexMap.size()) ? m_aXineramaScreenIndexMap[i] : 0;
+#if GTK_CHECK_VERSION(2,14,0)
+ //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)
+ {
+ n = i;
+ break;
+ }
}
}
#endif
- return 0;
#endif
+
if( n >= 0 && size_t(n) < m_aXineramaScreenIndexMap.size() )
n = m_aXineramaScreenIndexMap[n];
return n;
More information about the Libreoffice-commits
mailing list