8013424: Regression: java.awt.datatransfer.FlavorListeners not notified on Linux/Java 7
Reviewed-by: anthony
--- 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;
}