[Libreoffice-commits] .: vcl/unx

Michael Meeks michael at kemper.freedesktop.org
Wed Oct 26 08:42:39 PDT 2011


 vcl/unx/gtk/app/gtksys.cxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 10bce0fbf39b80d0859119b005f62accefe7b35b
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Wed Oct 26 16:42:39 2011 +0100

    gtk3: fix another gdk_screen_get_monitor_plug_name instance

diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index 99624f1..4134b5d 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -186,7 +186,23 @@ rtl::OUString GtkSalSystem::GetScreenName(unsigned int nScreen)
     pScreen = getScreenMonitorFromIdx (mpDisplay, nScreen, nMonitor);
     if (!pScreen)
         return rtl::OUString();
+
+#if GTK_CHECK_VERSION(3,0,0) || GTK_CHECK_VERSION(2,14,0)
     pStr = gdk_screen_get_monitor_plug_name (pScreen, nMonitor);
+#else
+    static gchar (*get_fn) (GdkScreen *, int) = NULL;
+
+    GModule *module = g_module_open (NULL, (GModuleFlags) 0);
+    if (!g_module_symbol (module, "gdk_screen_get_monitor_plug_name",
+                          (gpointer *)&get_fn))
+        get_fn = NULL;
+    g_module_close (module);
+
+    if (get_fn)
+        pStr = get_fn (pScreen, nMonitor);
+    else
+        pStr = g_strdup_printf ("%d", nScreen);
+#endif
     rtl::OUString aRet (pStr, strlen (pStr), RTL_TEXTENCODING_UTF8);
     g_free (pStr);
     return aRet;


More information about the Libreoffice-commits mailing list