[Libreoffice-commits] .: vcl/unx

Caolán McNamara caolan at kemper.freedesktop.org
Thu Oct 7 09:04:29 PDT 2010


 vcl/unx/gtk/app/gtkdata.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit d53ac3474f8aa7596f34af67ff2be316e26a1542
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 7 17:03:17 2010 +0100

    gdk_screen_get_monitor_plug_name needs at least 2.14

diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 10b1c43..fe12691 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -251,13 +251,16 @@ 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)
         return sym_gdk_screen_get_primary_monitor( pScreen );
-    //gdk_screen_get_primary_monitor unavailable, take the first laptop monitor as the default
+#if GTK_CHECK_VERSION(2,14,0)
+    //gdk_screen_get_primary_monitor unavailable, take the first laptop monitor
+    //as the default. This fallback needs at least gtk 2.14.0
     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];
     }
+#endif
     return 0;
 #endif
 }


More information about the Libreoffice-commits mailing list