Ensure clipboard contents are only queried upon listening to the clipboard

MYC-Refactor
Hammy 3 years ago
parent dd541ca6ee
commit 98fa50142c

@ -24,8 +24,6 @@ class MacClipboardListener extends ClipboardListener implements Runnable {
MacClipboardListener() { MacClipboardListener() {
super(); super();
Transferable oldClipboardContents = clipboard.getContents(null);
myClipboardContents = new MyClipboardContent[] { clipboardUtils.getClipboardContents(oldClipboardContents) };
} }
/** /**
@ -188,6 +186,8 @@ class MacClipboardListener extends ClipboardListener implements Runnable {
*/ */
@Override @Override
void execute() { void execute() {
Transferable oldClipboardContents = clipboard.getContents(null);
myClipboardContents = new MyClipboardContent[] { clipboardUtils.getClipboardContents(oldClipboardContents) };
scheduledExecutorService.scheduleAtFixedRate(this, 0, 200, TimeUnit.MILLISECONDS); scheduledExecutorService.scheduleAtFixedRate(this, 0, 200, TimeUnit.MILLISECONDS);
} }
} }

Loading…
Cancel
Save