8013424: Regression: java.awt.datatransfer.FlavorListeners not notified on Linux/Java 7
authorant
Thu, 30 May 2013 18:23:21 +0400
changeset 17892 b330b424a882
parent 17891 706fb153f43d
child 17893 a34977112c8b
8013424: Regression: java.awt.datatransfer.FlavorListeners not notified on Linux/Java 7 Reviewed-by: anthony
jdk/src/solaris/classes/sun/awt/X11/XClipboard.java
--- a/jdk/src/solaris/classes/sun/awt/X11/XClipboard.java	Thu May 30 18:10:26 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XClipboard.java	Thu May 30 18:23:21 2013 +0400
@@ -179,6 +179,7 @@
             }
             synchronized (XClipboard.classLock) {
                 if (targetsAtom2Clipboard != null && !targetsAtom2Clipboard.isEmpty()) {
+                    // The viewer is still registered, schedule next poll.
                     XToolkit.schedule(this, XClipboard.getPollInterval());
                 }
             }
@@ -191,7 +192,8 @@
                 final XSelectionEvent xse = ev.get_xselection();
                 XClipboard clipboard = null;
                 synchronized (XClipboard.classLock) {
-                    if (targetsAtom2Clipboard != null && !targetsAtom2Clipboard.isEmpty()) {
+                    if (targetsAtom2Clipboard != null && targetsAtom2Clipboard.isEmpty()) {
+                        // The viewer was unregistered, remove the dispatcher.
                         XToolkit.removeEventDispatcher(XWindow.getXAWTRootWindow().getWindow(), this);
                         return;
                     }