summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-03-15 10:38:06 +0000
committerFridrich Strba <fridrich@documentfoundation.org>2013-03-16 16:06:17 +0000
commit69cf6bf3e367aaf46107af96d7a6bd0aef8f667c (patch)
tree592b604c0432b0498f6905a081c3596388aac6ff /vcl
parent98057f51ef662f5da25891fed01a4ccfa280b2e9 (diff)
Resolves: rhbz#906137 slide show inverts outputs
we go to some effort to determine the right value of ret and then throw it away and return 0 regression since 4a7e3482912c90b73d6e12c82bcd9ce31975e3f1 Change-Id: I652cfbe44fdab6560c1c8dc8fe25d6211b5357cb (cherry picked from commit 67aae198f80195e77bd62e7675a372312075b126) Reviewed-on: https://gerrit.libreoffice.org/2743 Reviewed-by: Michael Meeks <michael.meeks@suse.com> Tested-by: Michael Meeks <michael.meeks@suse.com> Related: rhbz#906137 g_module_symbol returned nothing for gdk_screen_get_primary_monitor but osl_getAsciiFunctionSymbol does the right thing Change-Id: Ibf1a17724a9393d95c4fbe0d26aa82148eea33a9 Reviewed-on: https://gerrit.libreoffice.org/2744 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org> Reviewed-on: https://gerrit.libreoffice.org/2745 Reviewed-by: Michael Meeks <michael.meeks@suse.com> Reviewed-by: Joren De Cuyper <joren.libreoffice@telenet.be>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk/app/gtksys.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index b7996c110ae1..48bc239fd8b7 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -18,7 +18,6 @@
*/
#include <string.h>
-#include <gmodule.h>
#include <gtk/gtk.h>
#include <unx/gtk/gtkinst.hxx>
#include <unx/gtk/gtksys.hxx>
@@ -179,14 +178,14 @@ namespace {
static int _fallback_get_primary_monitor (GdkScreen *pScreen)
{
// Use monitor name as primacy heuristic
- int ret = -1;
int max = gdk_screen_get_n_monitors (pScreen);
- for (int i = 0; i < max && ret < 0; i++)
+ for (int i = 0; i < max; ++i)
{
char *name = gdk_screen_get_monitor_plug_name (pScreen, i);
- if (name && !g_ascii_strncasecmp (name, "LVDS", 4))
- ret = i;
+ bool bLaptop = (name && !g_ascii_strncasecmp (name, "LVDS", 4));
g_free (name);
+ if (bLaptop)
+ return i;
}
return 0;
}
@@ -201,11 +200,8 @@ static int _get_primary_monitor (GdkScreen *pScreen)
// Perhaps we have a newer gtk+ with this symbol:
if (!get_fn)
{
- GModule *module = g_module_open (NULL, (GModuleFlags) 0);
- if (!g_module_symbol (module, "gdk_screen_get_primary_monitor",
- (gpointer *)&get_fn))
- get_fn = NULL;
- g_module_close (module);
+ get_fn = (int(*)(GdkScreen*))osl_getAsciiFunctionSymbol(NULL,
+ "gdk_screen_get_primary_monitor");
}
#if GTK_CHECK_VERSION(2,14,0)
if (!get_fn)