Ensure that files are not notified as text to end users

MYC-Refactor
sgoudham 3 years ago
parent 8b467ab3d9
commit 05dd51546f
No known key found for this signature in database
GPG Key ID: EF51A29A50FB754C

@ -27,12 +27,13 @@ class MacClipboardListener extends ClipboardListener {
*/
void checkText(Transferable newClipboardContents, MyClipboardContent<?>[] myClipboardContents) {
if (isTextMonitored()) {
if (TEXT.isAvailable(clipboard)) {
if (TEXT.isAvailable(clipboard) && !FILELIST.isAvailable(clipboard)) {
String newStringContent = getStringContent(newClipboardContents);
if (newStringContent == null) return;
if (!newStringContent.equals(myClipboardContents[0].getOldContent())) {
OldClipboardContent oldClipboardContent = ClipboardUtils.getOldClipboardContent(myClipboardContents[0].getOldContent());
Object oldContent = myClipboardContents[0].getOldContent();
if (!newStringContent.equals(oldContent)) {
OldClipboardContent oldClipboardContent = ClipboardUtils.getOldClipboardContent(oldContent);
getEventManager().notifyTextEvent(oldClipboardContent, newStringContent);
myClipboardContents[0].setOldContent(newStringContent);
}

Loading…
Cancel
Save