diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java index abd8b2446dc..619e5212782 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java @@ -116,6 +116,8 @@ enum APPEARANCE { APPEARANCE appAppearance; /* System property to be set for SWT application to use the system's theme */ static final String USE_SYSTEM_THEME = "org.eclipse.swt.display.useSystemTheme"; + /* System property to control beep sounds */ + public static final boolean BEEP_ENABLED = !"off".equalsIgnoreCase(System.getProperty("swt.beep")); /* Windows and Events */ Event [] eventQueue; @@ -671,7 +673,9 @@ public void execute(Runnable runnable) { */ public void beep () { checkDevice (); - OS.NSBeep (); + if (BEEP_ENABLED) { + OS.NSBeep (); + } } void cascadeWindow (NSWindow window, NSScreen screen) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java index 5b52c106f48..d6b6f41902f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java @@ -509,6 +509,8 @@ public void stop() { /* Package name */ static final String PACKAGE_PREFIX = "org.eclipse.swt.widgets."; //$NON-NLS-1$ + /* System property to control beep sounds */ + public static final boolean BEEP_ENABLED = !"off".equalsIgnoreCase(System.getProperty("swt.beep")); /* This code is intentionally commented. * ".class" can not be used on CLDC. */ @@ -988,7 +990,9 @@ public void execute(Runnable runnable) { */ public void beep () { if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); - GDK.gdk_display_beep(GDK.gdk_display_get_default()); + if (BEEP_ENABLED) { + GDK.gdk_display_beep(GDK.gdk_display_get_default()); + } } long cellDataProc (long tree_column, long cell, long tree_model, long iter, long data) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java index 12ed1c2f9d5..4d41a343bb2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java @@ -224,6 +224,8 @@ public class Display extends Device implements Executor { boolean useWsBorderTable = false; static final String USE_WS_BORDER_TEXT_KEY = "org.eclipse.swt.internal.win32.Text.use_WS_BORDER"; //$NON-NLS-1$ boolean useWsBorderText = false; + /* System property to control beep sounds */ + public static final boolean BEEP_ENABLED = !"off".equalsIgnoreCase(System.getProperty("swt.beep")); /** * Changes the color of Table header's column delimiters. * Only affects custom-drawn header, that is when background/foreground header color is set. @@ -852,7 +854,9 @@ public void execute(Runnable runnable) { */ public void beep () { checkDevice (); - OS.MessageBeep (OS.MB_OK); + if (BEEP_ENABLED) { + OS.MessageBeep (OS.MB_OK); + } } /**