summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index fdca512960a1..8183741c4121 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
}