diff --git a/src/solaris/native/sun/awt/awt_util.h b/src/solaris/native/sun/awt/awt_util.h index dd0be228269808f7d29eae6d62fc2991eb90aad5..87089054e465ad26de362422703ce5f70d06f8f2 100644 --- a/src/solaris/native/sun/awt/awt_util.h +++ b/src/solaris/native/sun/awt/awt_util.h @@ -52,6 +52,8 @@ */ extern XErrorHandler current_native_xerror_handler; +Window get_xawt_root_shell(JNIEnv *env); + #endif /* !HEADLESS */ #ifndef INTERSECTS diff --git a/src/solaris/native/sun/xawt/XlibWrapper.c b/src/solaris/native/sun/xawt/XlibWrapper.c index 60298f7c4d300a9084f1a1cb5238bf58aa6ba45f..f1d63185186c3e7d099058337935f39372db1067 100644 --- a/src/solaris/native/sun/xawt/XlibWrapper.c +++ b/src/solaris/native/sun/xawt/XlibWrapper.c @@ -2011,10 +2011,14 @@ static Bool exitSecondaryLoop = True; * Toolkit thread to process PropertyNotify or SelectionNotify events. */ static Bool -secondary_loop_event(Display* dpy, XEvent* event, char* arg) { - return (event->type == SelectionNotify || - event->type == SelectionClear || - event->type == PropertyNotify) ? True : False; +secondary_loop_event(Display* dpy, XEvent* event, XPointer xawt_root_window) { + return ( + event->type == SelectionNotify || + event->type == SelectionClear || + event->type == PropertyNotify || + (event->type == ConfigureNotify + && event->xany.window == *(Window*) xawt_root_window) + ) ? True : False; } @@ -2025,8 +2029,11 @@ Java_sun_awt_X11_XlibWrapper_XNextSecondaryLoopEvent(JNIEnv *env, jclass clazz, AWT_CHECK_HAVE_LOCK_RETURN(JNI_FALSE); exitSecondaryLoop = False; + Window xawt_root_window = get_xawt_root_shell(env); + while (!exitSecondaryLoop) { - if (XCheckIfEvent((Display*) jlong_to_ptr(display), (XEvent*) jlong_to_ptr(ptr), secondary_loop_event, NULL)) { + if (XCheckIfEvent((Display*) jlong_to_ptr(display), + (XEvent*) jlong_to_ptr(ptr), secondary_loop_event, (XPointer) &xawt_root_window)) { return JNI_TRUE; } timeout = (timeout < AWT_SECONDARY_LOOP_TIMEOUT) ? (timeout << 1) : AWT_SECONDARY_LOOP_TIMEOUT;