diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-12 13:16:29 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-12 15:57:01 +0200 |
commit | 345b5bc75883a5f4c3b8b6a5b70e45cacce0109e (patch) | |
tree | 4654f6905204599fa750dc170e0dd601a6946d87 | |
parent | a48ec324d284123f7ad6d0addfdc8c6789fd8d47 (diff) |
clarify when XInitThreads is called
and make the minor version checks more sensible
Change-Id: Ieee6750e4e8dd79213a0befb040ce7b8a815e357
Reviewed-on: https://gerrit.libreoffice.org/61713
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/unx/gtk/gtkinst.cxx | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx index 1366bf84a62e..77a6b9dc15ab 100644 --- a/vcl/unx/gtk/gtkinst.cxx +++ b/vcl/unx/gtk/gtkinst.cxx @@ -66,13 +66,28 @@ extern "C" "vcl.gtk", "create vcl plugin instance with gtk version " << gtk_major_version << " " << gtk_minor_version << " " << gtk_micro_version); + +#if !GTK_CHECK_VERSION(3,0,0) if( gtk_major_version < 2 || // very unlikely sanity check ( gtk_major_version == 2 && gtk_minor_version < 4 ) ) { g_warning("require a newer gtk than %d.%d for gdk_threads_set_lock_functions", static_cast<int>(gtk_major_version), gtk_minor_version); return nullptr; } +#else + if (gtk_major_version == 3 && gtk_minor_version < 18) + { + g_warning("require gtk >= 3.18 for theme expectations"); + return nullptr; + } +#endif + // for gtk2 it is always built with X support, so this is always called + // for gtk3 it is normally built with X and Wayland support, if + // X is supported GDK_WINDOWING_X11 is defined and this is always + // called, regardless of if we're running under X or Wayland. + // We can't use (GDK_IS_X11_DISPLAY(pDisplay)) to only do it under + // X, because we need to do it earlier than we have a display #if !GTK_CHECK_VERSION(3,0,0) || defined(GDK_WINDOWING_X11) /* #i92121# workaround deadlocks in the X11 implementation */ @@ -85,14 +100,6 @@ extern "C" XInitThreads(); #endif -#if GTK_CHECK_VERSION(3,0,0) - if (gtk_minor_version < 18) - { - g_warning("require a newer gtk than 3.%d for theme expectations", gtk_minor_version); - return nullptr; - } -#endif - // init gdk thread protection bool const sup = g_thread_supported(); // extracted from the 'if' to avoid Clang -Wunreachable-code |