summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-02-17 16:09:01 +0000
committerAndras Timar <andras.timar@collabora.com>2016-02-22 08:58:18 +0100
commit1aa00af07054b896c9e8500b2f409a70f7052550 (patch)
treeed0a48ea31ac38b411a54e447cf175cf7149dadf
parent2b354fbaeb1b59419bd82eabc7b3f01b2da3c315 (diff)
Resolves: rhbz#1285356 force swing not to use gtk2 if gtk3 is loaded
Reviewed-on: https://gerrit.libreoffice.org/22433 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> (cherry picked from commit 9f7f881d11ceb4e2534758b9507a55292ec697b0) Change-Id: I6347bf4c25ce649073afdfe4225182ab2dc84af1 Reviewed-on: https://gerrit.libreoffice.org/22464 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit c2acf9204dae3582adc608ad28ef018c0c82f24e)
-rw-r--r--stoc/source/javavm/javavm.cxx9
-rw-r--r--vcl/unx/gtk/app/gtksys.cxx7
2 files changed, 15 insertions, 1 deletions
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 8ccd0c108540..ccf51a3d1a55 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -538,8 +538,15 @@ void initVMConfiguration(
}
*pjvm= jvm;
- setTimeZone(pjvm);
+ // rhbz#1285356, native look will be gtk2, which crashes
+ // when gtk3 is already loaded. Until there is a solution
+ // java-side force look and feel to something that doesn't
+ // crash when we are using gtk3
+ if (getenv("STOC_FORCE_SYSTEM_LAF"))
+ pjvm->pushProp("swing.systemlaf=javax.swing.plaf.metal.MetalLookAndFeel");
+
+ setTimeZone(pjvm);
}
class DetachCurrentThread: private boost::noncopyable {
diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index f1142210cf3e..7d687b23943f 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -40,6 +40,13 @@ GtkSalSystem::GtkSalSystem() : SalGenericSystem()
{
mpDisplay = gdk_display_get_default();
countScreenMonitors();
+#if GTK_CHECK_VERSION(3,0,0)
+ // rhbz#1285356, native look will be gtk2, which crashes
+ // when gtk3 is already loaded. Until there is a solution
+ // java-side force look and feel to something that doesn't
+ // crash when we are using gtk3
+ setenv("STOC_FORCE_SYSTEM_LAF", "true", 1);
+#endif
}
GtkSalSystem::~GtkSalSystem()