diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java index e16c55675d4..5825277207b 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java @@ -275,7 +275,7 @@ public class XEmbeddedFramePeer extends XFramePeer { Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(), XToolkit.getDefaultRootWindow(), new Point(0, 0)); - return absoluteLoc.x; + return absoluteLoc != null ? absoluteLoc.x : 0; } public int getAbsoluteY() @@ -283,7 +283,7 @@ public class XEmbeddedFramePeer extends XFramePeer { Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(), XToolkit.getDefaultRootWindow(), new Point(0, 0)); - return absoluteLoc.y; + return absoluteLoc != null ? absoluteLoc.y : 0; } public int getWidth() { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java index 0be90d02d20..3b98cb032fb 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -849,7 +849,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { // if _NET_WM_STRUT_PARTIAL is present, we should use its values to detect // if the struts area intersects with screenBounds, however some window // managers don't set this hint correctly, so we just get intersection with windowBounds - if (windowBounds.intersects(screenBounds)) + if (windowBounds != null && windowBounds.intersects(screenBounds)) { insets.left = Math.max((int)Native.getLong(native_ptr, 0), insets.left); insets.right = Math.max((int)Native.getLong(native_ptr, 1), insets.right); @@ -1961,7 +1961,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } static long reset_time_utc; - static final long WRAP_TIME_MILLIS = Integer.MAX_VALUE; + static final long WRAP_TIME_MILLIS = 0x00000000FFFFFFFFL; /* * This function converts between the X server time (number of milliseconds diff --git a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c index 717a38382d7..f044364220c 100644 --- a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c +++ b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c @@ -52,11 +52,15 @@ JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_quit { if (dialog != NULL) { + fp_gdk_threads_enter(); + fp_gtk_widget_hide (dialog); fp_gtk_widget_destroy (dialog); fp_gtk_main_quit (); dialog = NULL; + + fp_gdk_threads_leave(); } } @@ -162,7 +166,6 @@ Java_sun_awt_X11_GtkFileDialogPeer_run(JNIEnv * env, jobject jpeer, (*env)->GetJavaVM(env, &jvm); } - fp_gdk_threads_init(); fp_gdk_threads_enter(); const char *title = (*env)->GetStringUTFChars(env, jtitle, 0); diff --git a/jdk/test/java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java b/jdk/test/java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java index 323ede04139..f93c2cd746b 100644 --- a/jdk/test/java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java +++ b/jdk/test/java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java @@ -83,6 +83,12 @@ public class FilenameFilterTest extends Applet if (fd == null) { throw new RuntimeException("fd is null (very unexpected thing :("); } + //Wait a little; some native dialog implementations may take a while + //to initialize and call the filter. See 6959787 for an example. + try { + Thread.sleep(5000); + } catch (Exception ex) { + } fd.dispose(); if (!filter_was_called) { throw new RuntimeException("Filter was not called");