. Switch to using XToolkit by default. According to

http://java.sun.com/j2se/1.5.0/docs/guide/awt/1.5/xawt.html

  it has some advantages over XToolkit.  Its also the default on Linux
  and Solaris will be switching to it.  Some people have reported that
  it fixes a crash in the browser plugin for them.

  Please let me know straight away if this causes problems, particularly
  with Swing, as it hasn't been extensively tested.  The web page
  mentioned above explains how to switch the toolkits dynamically so you
  can compare them.

Submitted by:	Huang wen hui <hwh@gddsn.org.cn>
                (the awt_LoadLibrary.c patch)
Approved by:	phantom (maintainer)
This commit is contained in:
Greg Lewis 2005-10-13 15:18:25 +00:00
parent 03fdfe46e6
commit 7768284774
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=145272
4 changed files with 68 additions and 0 deletions

View file

@ -0,0 +1,20 @@
$FreeBSD$
--- ../../j2se/src/share/classes/java/awt/Toolkit.java 10 Jan 2005 07:40:41 -0000 1.2
+++ ../../j2se/src/share/classes/java/awt/Toolkit.java 9 Oct 2005 04:11:13 -0000
@@ -809,12 +809,11 @@
try {
String defaultToolkit;
- /* XXXBSD: analyze and choose better one */
- if (System.getProperty("os.name").equals("Linux")) {
- defaultToolkit = "sun.awt.X11.XToolkit";
+ if (System.getProperty("os.name").equals("SunOS")) {
+ defaultToolkit = "sun.awt.motif.MToolkit";
}
else {
- defaultToolkit = "sun.awt.motif.MToolkit";
+ defaultToolkit = "sun.awt.X11.XToolkit";
}
nm = System.getProperty("awt.toolkit",
defaultToolkit);

View file

@ -0,0 +1,14 @@
$FreeBSD$
--- ../../j2se/src/solaris/native/sun/awt/awt_LoadLibrary.c 10 Jan 2005 15:09:40 -0000 1.2
+++ ../../j2se/src/solaris/native/sun/awt/awt_LoadLibrary.c 9 Oct 2005 05:34:52 -0000
@@ -195,8 +195,7 @@
}
}
else {
-/* XXXBSD: decide which toolkit to use */
-#if defined(__linux)
+#if defined(__linux) || defined(_ALLBSD_SOURCE)
/* Default AWT Toolkit on Linux is XAWT. */
strcpy(p, "/xawt/libmawt");
XAWT = 1;

View file

@ -0,0 +1,20 @@
$FreeBSD$
--- ../../j2se/src/share/classes/java/awt/Toolkit.java 10 Jan 2005 07:40:41 -0000 1.2
+++ ../../j2se/src/share/classes/java/awt/Toolkit.java 9 Oct 2005 04:11:13 -0000
@@ -809,12 +809,11 @@
try {
String defaultToolkit;
- /* XXXBSD: analyze and choose better one */
- if (System.getProperty("os.name").equals("Linux")) {
- defaultToolkit = "sun.awt.X11.XToolkit";
+ if (System.getProperty("os.name").equals("SunOS")) {
+ defaultToolkit = "sun.awt.motif.MToolkit";
}
else {
- defaultToolkit = "sun.awt.motif.MToolkit";
+ defaultToolkit = "sun.awt.X11.XToolkit";
}
nm = System.getProperty("awt.toolkit",
defaultToolkit);

View file

@ -0,0 +1,14 @@
$FreeBSD$
--- ../../j2se/src/solaris/native/sun/awt/awt_LoadLibrary.c 10 Jan 2005 15:09:40 -0000 1.2
+++ ../../j2se/src/solaris/native/sun/awt/awt_LoadLibrary.c 9 Oct 2005 05:34:52 -0000
@@ -195,8 +195,7 @@
}
}
else {
-/* XXXBSD: decide which toolkit to use */
-#if defined(__linux)
+#if defined(__linux) || defined(_ALLBSD_SOURCE)
/* Default AWT Toolkit on Linux is XAWT. */
strcpy(p, "/xawt/libmawt");
XAWT = 1;