Skip to content

Commit

Permalink
JBR-6183 Wayland: clipboard-related exception in headless environment
Browse files Browse the repository at this point in the history
  • Loading branch information
mkartashev authored and jbrbot committed Nov 8, 2024
1 parent 67c8c4d commit e302f47
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/java.desktop/unix/classes/sun/awt/wl/WLToolkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,18 @@ public WLToolkit() {
toolkitSystemThread.setDaemon(true);
toolkitSystemThread.start();

// Wait here for all display sync events to have been received?
}
WLClipboard selectionClipboard = null;
try {
selectionClipboard = new WLClipboard("Selection", true);
} catch (UnsupportedOperationException ignored) {
}

WLClipboard selectionClipboard = null;
try {
selectionClipboard = new WLClipboard("Selection", true);
} catch (UnsupportedOperationException ignored) {
clipboard = new WLClipboard("System", false);
selection = selectionClipboard;
} else {
clipboard = null;
selection = null;
}

clipboard = new WLClipboard("System", false);
selection = selectionClipboard;
}

public static boolean isToolkitThread() {
Expand Down

0 comments on commit e302f47

Please sign in to comment.