src/java.desktop/unix/classes/sun/awt/X11/XClipboard.java

Print this page

        

*** 154,163 **** --- 154,165 ---- protected void registerClipboardViewerChecked() { // for XConvertSelection() to be called for the first time in getTargetsDelayed() isSelectionNotifyProcessed = true; boolean mustSchedule = false; + XToolkit.awtLock(); + try { synchronized (XClipboard.classLock) { if (targetsAtom2Clipboard == null) { targetsAtom2Clipboard = new HashMap<Long, XClipboard>(2); } mustSchedule = targetsAtom2Clipboard.isEmpty();
*** 168,177 **** --- 170,182 ---- } } if (mustSchedule) { XToolkit.schedule(new CheckChangeTimerTask(), XClipboard.getPollInterval()); } + } finally { + XToolkit.awtUnlock(); + } } private static class CheckChangeTimerTask implements Runnable { public void run() { for (XClipboard clpbrd : targetsAtom2Clipboard.values()) {