Skip to content

Commit

Permalink
Add ENIGMA_DISABLE_CLIPBOARD env var
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Sep 28, 2024
1 parent 8f1d0bc commit d819797
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class GuiUtil {
public static final Icon FIELD_ICON = loadIcon("field");
public static final Icon CONSTRUCTOR_ICON = loadIcon("constructor");

private static final boolean DISABLE_CLIPBOARD = System.getenv("ENIGMA_DISABLE_CLIPBOARD") != null;

public static void openUrl(String url) {
try {
switch (Os.getOs()) {
Expand Down Expand Up @@ -90,6 +92,10 @@ public static void copyToClipboard(String text) {
}

public static boolean hasClipboardText() {
if (DISABLE_CLIPBOARD) {
return false;
}

Clipboard systemClipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable contents = systemClipboard.getContents(null);

Expand Down

0 comments on commit d819797

Please sign in to comment.