File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
src/java.desktop/unix/classes/sun/awt/wl Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -368,18 +368,22 @@ private boolean isPopupPositionUnconstrained() {
368368 protected void wlSetVisible (boolean v ) {
369369 // TODO: this whole method should be moved to WLWindowPeer
370370 synchronized (getStateLock ()) {
371- if (this .visible == v ) return ;
372-
373- if (v ) {
374- show ();
371+ // TODO: make sure visibility state cannot be changed midway through this method
372+ if (visible == v ) return ;
373+ }
374+ if (v ) {
375+ show ();
376+ synchronized (getStateLock ()) {
375377 // Consider the window visible only if show() fully succeeds.
376378 visible = true ;
377- } else {
379+ }
380+ } else {
381+ synchronized (getStateLock ()) {
378382 // Hiding is presumed to succeed even if an error occurs in the process
379383 // in the sense that a subsequent request to hide() will not do anything useful.
380384 visible = false ;
381- hide ();
382385 }
386+ hide ();
383387 }
384388 }
385389
You can’t perform that action at this time.
0 commit comments