This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 203979

Summary: Error sound when saving already-saved file.
Product: platform Reporter: Dekudude
Component: Window SystemAssignee: Stanislav Aubrecht <saubrecht>
Status: RESOLVED FIXED    
Severity: normal CC: daprezjer, karmaflute
Priority: P4    
Version: 8.0   
Hardware: PC   
OS: All   
Issue Type: TASK Exception Reporter:
Attachments: Proposed changes

Description Dekudude 2011-10-19 16:37:57 UTC
On Windows 7 (not tested in other operating systems) when you Ctrl+S a file that's already saved, the Windows error sound plays. This is very annoying, and is quite distracting when you are in the habit of continually pressing Ctrl+S during work.

This should be simple to fix.
Comment 1 Svata Dedic 2011-10-20 07:48:45 UTC
Well, the system beeps because you're trying to execute an action (Save) which is currently disabled for some reason. 
For most actions, it's rather desirable to be warned that the keystroke has no effect at all. Possibly even for Save, as usually an user attempts to save file after some changes was made.
Comment 2 Dekudude 2011-10-20 13:08:08 UTC
(In reply to comment #1)
> Well, the system beeps because you're trying to execute an action (Save) which
> is currently disabled for some reason. 
> For most actions, it's rather desirable to be warned that the keystroke has no
> effect at all. Possibly even for Save, as usually an user attempts to save file
> after some changes was made.

Would an option for the user to choose be possible, then? While I understand your reasoning, I don't think I would be able to find anyone that wants to hear that beep when they're simply Ctrl+S'ing a file. What you're saying does make sense in theory, but in practice, it's a superfluous notification.
Comment 3 Svata Dedic 2011-10-20 18:25:02 UTC
Maybe, maybe not. For me as a quick typer it's a sign that something went wrong in the keystroke sequence - not for Save specifically, but for other operations.

So; let's decrease the priority and leave it as an enhancement. Feel free to vote for it, if it receives enough votes, the priority will go up.
Comment 4 RyanAlbarelli 2012-02-03 14:59:59 UTC
The beep behavior is inconsistent with nominal application behavior in Linux, Windows and Mac (in fact there are separate bug reports for this issue listed under each).

I agree that it makes sense to beep if someone activates a disabled action. 

However, I believe the problem is that Netbeans is trying to be too smart on disabling those actions. The save action means "make sure my file is saved to disk" not "write bytes to disk". NB can optimize whether it writes to disk in the back end without bothering me with that detail. The same issue is annoying with "fix imports". Why do I (as a user) care whether NB already determined that no imports need fixing? The request "make sure all imports are fixed" is a valid request at all times that I have a java file open.

I would be more than satisfied with a simple means of disabling all sounds in Netbeans.
Thanks
Comment 5 daprezjer 2012-11-20 05:57:54 UTC
I just wanted to second Dekudude's request.  Many coders by habit - and I'd say good practice - periodically hit the save button.  This habit has been re-inforced by all other IDEs that I know of which do not respond with an error sound when something is saved.  So when you work in a small office with a bunch of coders all day like I do, the constant highly annoying beep is enough to drive you nuts.  Of course, we could all turn down our sound (and sometimes do), but this gets tedious as there are many sounds we actually do want to hear.

Thanks for you consideration.
Comment 6 Svata Dedic 2012-11-20 10:28:37 UTC
OK, notable thing is, that the beep on disabled action (i.e. save on an unmodified file) is handled centrally. So we have several options here:

a/ make the Save Action always enabled. This would eliminate the beep, but may be confusing, since the action in menu and icon in toolbar would be always painted as active.

b/ make a way for Save action (possibly for others) to mark themselves as 'not as important' so they won't beep when invoked in disabled state. Slightly confusing for developers, because of blurry definition of 'not as important' 

c/ stop beeping when action to be executed is disabled. The drawback is that the user won't be alerted that a keypress did not function as expected.

d/ create an option in Tools | Options to turn off/on beeping on disabled actions, default on. Same drawback as (c), but user ackowledges the responsibility by turning the option off.

My preference is d, b, c. I don't recommend a.

Petre - your advice ?
Comment 7 Petr Somol 2012-12-10 12:23:15 UTC
(In reply to comment #6)
> a/ make the Save Action always enabled. This would eliminate the beep, but may
> be confusing, since the action in menu and icon in toolbar would be always
> painted as active.
> 
> b/ make a way for Save action (possibly for others) to mark themselves as 'not
> as important' so they won't beep when invoked in disabled state. Slightly
> confusing for developers, because of blurry definition of 'not as important' 
> 
> c/ stop beeping when action to be executed is disabled. The drawback is that
> the user won't be alerted that a keypress did not function as expected.
> 
> d/ create an option in Tools | Options to turn off/on beeping on disabled
> actions, default on. Same drawback as (c), but user ackowledges the
> responsibility by turning the option off.
> 
> My preference is d, b, c. I don't recommend a.

a) is not acceptable due to the introduced inconsistency
b) 'not as important' if exposed to users would be a misleading concept, wrong from usability point of view. We need to strive for simplicity. Even if not exposed, the change in behavior between non-'not as important' and 'not as important' can be felt as confusing or at least inconsistent.
c) another inconsistency (between OS and NB behavior) + negative effect in situations that are unrelated to this particular issue
d) increases Options clutter

All options introduce something undesirable from usability point of view. The least harm would be probably caused by d), although it does not feel right to me either (why to replicate an option that can be disabled to the same effect system-wide ?)

Svata, would it be possible to have one new always active (thus never beeping) action 'Save if not saved' that would not be displayed anywhere in the menus, would initially have no shortcut, but that would be assignable to Ctrl-S manually by users if they wanted to ?
Comment 8 RyanAlbarelli 2012-12-10 13:55:07 UTC
Really? With regard to c), what operating system are you using that beeps when you push save on an unmodified file? I'm using the most popular desktop OS in the world, and it hasn't had this bug/behavior for at least the 20 years I've been using it. I've never had to go into a program's options to assign a ctrl-s shortcut to a "save if not saved" action to stop a sound, I just go into the OS settings and disable all my sounds.

Since you only make one sound, you could skip the complex sound assignment dialog and just add a config option for "error sound: (*) mute (*) default sound (*) custom sound [edit box] [browse button]". That's what we use for in-house apps and it works great.

There, now you've enhanced the program, retained consistency and added a feature long understood by users of Linux/Windows.
Comment 9 Petr Somol 2012-12-10 14:12:58 UTC
I might be indeed wrong regarding the retake of system error sound. Svata please clarify. If NB uses its own sounds, then allowing to customize sounds through Options seems to make more sense..
Comment 10 Svata Dedic 2012-12-10 14:42:00 UTC
The action system uses Toolkit.getDefault().beep(); so rather than 'its own sound' it uses the system (JDK) default one. I don't follow the comment #8 with adding some sound (?) configuration. If it was meant as a suggestion to add sound configuration to NetBeans, then it's a sub-case of option (d), with the pros/cons already explored in comment #7.

Note that the issue combines 2 factors:
1/ the Save action is only enabled, when it makes sense to save the file (the editor is dirty)
2/ the action system treats an attempt to execute disabled action as an error.

IMHO playing error sound is definitely OK from the POV of the action infrastructure, since no one should be attempting to execute something which is reported as disabled everywhere in the UI. As said above, not all actions have the same property as "Save" - that is, if it is disabled, the action's effect is already in place and the user does not need to worry. You'd like to be warned on CTRL-C, when the object is not allowed to copy, for example.

Given the above, Petr's suggestion to create an alternative "Save if not saved" is nice, because 
a/ it exactly matches the reporter's requirement, to "Save if not saved, or do nothing"
b/ it does not increase option clutter, since it cleverly reuses existing options to provide reporter's desired behaviour.

So the thing to decide is now, whether we'll treat Save specially (original request and comment #2), or change error beeping behaviour of entire application  (comment #8)
Comment 11 Petr Somol 2012-12-10 15:05:58 UTC
> So the thing to decide is now, whether we'll treat Save specially (original
> request and comment #2), or change error beeping behaviour of entire
> application  (comment #8)

As Svata is in agreement with the idea I proposed in Comment #7, it seems to me the better way regarding this particular issue as it addresses specifically what this issue has been filed for. The question whether to allow global modification of all error sounds can be considered just part of the bigger question of handling all sounds in NB and as such beyond the scope of this issue.

The question of sound in NB does not relate to errors only. The NB UI Steering Committee considers usage of (customizable) sounds for notification of various events, like the end of lengthy operations etc. (see Notification Center at http://wiki.netbeans.org/UIReviewsAreas).
Comment 12 Svata Dedic 2012-12-11 13:09:54 UTC
The proposed actions would fit into platform/actions component; reassigning.
Comment 13 andrew.finnell 2013-03-04 18:37:38 UTC
The beeping is extremely annoying. No other application or IDE does this. Can the team not get hung up on idealistic notions and make sure there is at least an option to change this to be more practical?
Comment 14 daprezjer 2013-03-08 00:30:41 UTC
Thanks Jaroslav an Netbeans for keeping this open.
Comment 15 Svata Dedic 2013-06-26 11:35:33 UTC
*** Bug 230700 has been marked as a duplicate of this bug. ***
Comment 16 melight 2013-10-09 08:17:44 UTC
Guys, it's been 2 years since the original bug report - but I'm still not able to disable sounds on the IDE! (What other IDE makes sounds anyway?). My whole office hears the beeps of my IDE through the music playing on my speakers. It's annoying, but what's even worse is that this feature is useless. I bet a beer not even a single developer will miss the beep when it's gone nor will anyone have a productivity drop.

I really don't understand the motivation in keeping this feature - it makes the NetBeans experience a tiny bit more annoying. Imagine you have an IDE that randomly screams "HI!!" at you. You could go explaining how important this is for consistency, correct exceptions handling, and informational user interface - but the bottom line is it hurts the experience and brings no value.

Please add a tiny checkbox to make it quiet.

And of course thanks for the great work you're doing!
Comment 17 nbsocko 2013-10-09 17:22:27 UTC
I don't ever want to hear a beep -- not on save, *especially* not when a search fails, never, ever, ever.  I'm not in elementary school computer science lab.  Please remove all sound, or add an option to keep the IDE completely quiet.

Is it realized and/or acknowledged that there is a <a href="https://netbeans.org/bugzilla/show_bug.cgi?id=27275">twelve year old bug report</a> on this site that is currently listed as open which addresses this issue?  Twelve years old.  Please put this to rest by adding a simple checkbox that disables sound.
Comment 18 melight 2013-10-09 17:49:18 UTC
Oh G-d! How could I forget the searches that fail - or didn't fail and simply reached the  end of file, before finding the first occurrence again!
Comment 19 karmaflute 2013-10-09 19:56:21 UTC
Listen to music while programming? NetBeans says no! :(
Comment 20 daprezjer 2014-02-03 06:59:47 UTC
Hey guys,

Any update?  Again, nothing in the world but Netbeans does this annoying beep.  Open up notepad, notepad++, dreamweaver, Eclipse, PhotoShop, Word, Open Office, Google docs, what have you.  Netbeans is the only one.  Please on your next update, rewrite "save" as "Save if not already saved" to rid us from this.  As other posters have mentioned, no one is going to complain.  You don't even need to write an option.  Just take it out.  If someone does complain, you can point to every other single program on the planet.

That being said, love the work!  But I just heard 5 annoying dings in the span of one minute, and it's starting to drive me nuts!
Comment 21 sajjadG 2014-02-06 15:39:11 UTC
The beep is so annoying. please do something about it.
It's possible to disable pc speaker in general by blacklisting/removing pcspkr module in Linux. but that's not a good solution for all users.
Comment 22 melight 2014-03-25 12:25:17 UTC
Version 8.0 is out and looking great, congrats!
Still, couldn't find a "no sounds" checkbox anywhere in the preferences. And the Save beeps goes on...
Comment 23 Zaxik 2014-04-18 10:02:18 UTC
Come on guys, vote this up, please. I've never ever seen a program that does this annoying sound when saving a file.

Many of us work on Windows, many of us don't want to turn off system sounds (because it's useful for other warnings, but not goddamn saving a saved file in NetBeans) and many of us would like to listen to music while working. Without stupid unnecessary interruptions, please.

----------

I call this "unnecessary stupidity" and I shall give you an example of that on something else than NetBeans:

I bought SteelSeries keyboard and it has a SteelSeries key instead of left Win key. The key does nothing at all when pressed alone, it's only for combination with F1-F6 to act as media keys. The people who made the keyboard claim that it's to prevent gamers from hitting the Win key by accident and dropping game on desktop. Well, that's all nice and everything, but why the hell can't I use Win+D? I'm not gonna hit THAT by accident. That's unnecessary stupidity.

So, don't be unnecessarily stupid when trying to make something. Make it smart, make it logical, don't annoy the user.

Thank you.
Comment 24 Leperous 2014-04-18 10:28:42 UTC
The beep behaviour is not only inconsistent with other applications, it is also internally inconsistent: the undo and redo key combinations don't cause it if they are disabled. Presumably, any solution to this lies with these two.

Ideally, the beep would only occur if an error occurred whilst saving the file to disk, e.g. it was read-only, rather than a no-op. It shouldn't be as crude as "because the button is disabled".

(In reply to Zaxik from comment #23)
> Come on guys, vote this up, please. I've never ever seen a program that does
> this annoying sound when saving a file.
> 
> Many of us work on Windows, many of us don't want to turn off system sounds
> (because it's useful for other warnings, but not goddamn saving a saved file
> in NetBeans) and many of us would like to listen to music while working.
> Without stupid unnecessary interruptions, please.
> 
> ----------
> 
> I call this "unnecessary stupidity" and I shall give you an example of that
> on something else than NetBeans:
> 
> I bought SteelSeries keyboard and it has a SteelSeries key instead of left
> Win key. The key does nothing at all when pressed alone, it's only for
> combination with F1-F6 to act as media keys. The people who made the
> keyboard claim that it's to prevent gamers from hitting the Win key by
> accident and dropping game on desktop. Well, that's all nice and everything,
> but why the hell can't I use Win+D? I'm not gonna hit THAT by accident.
> That's unnecessary stupidity.
> 
> So, don't be unnecessarily stupid when trying to make something. Make it
> smart, make it logical, don't annoy the user.
> 
> Thank you.
Comment 25 Ondrej Vrabec 2014-04-18 10:31:29 UTC
TopComponent.processKeyBinding calls Toolkit.getDefaultToolkit().beep() when the action (SaveAction for example) to be performed is disabled.
Comment 26 Stanislav Aubrecht 2014-04-18 12:33:19 UTC
Actually Toolkit.getDefaultToolkit().beep() is in at least 20 other places.

Also there's sound for disabled actions on Mac OS X and there's no such sound on MS Windows.
Comment 27 Zaxik 2014-04-22 17:46:35 UTC
Some people keep asking me "which sound? I'm using NetBeans and it makes no sounds", so I made a short video demonstration: https://www.youtube.com/watch?v=VLU5N2UGjeA
Comment 28 Stanislav Aubrecht 2014-07-04 13:35:18 UTC
Created attachment 147889 [details]
Proposed changes
Comment 29 Stanislav Aubrecht 2014-07-08 08:52:43 UTC
If there are no objections I'll integrate the changes tomorrow.
Comment 30 Stanislav Aubrecht 2014-07-09 13:20:01 UTC
Toolkit.beep() is actually all over the code base but I disabled the sound at some of the most prominent places in core-main 7495400878cd
The sounds are disabled for MS Windows only. If there's some other platform that doesn't give audio feedback when invoking a disabled action please reopen this bug.

If you are on MS Windows and still hear a sound in the IDE where you think there shouldn't be any sound please file a new bug against the module that implements the feature that produces the beep.
Comment 31 Quality Engineering 2014-07-19 10:15:30 UTC
Integrated into 'main-silver', will be available in build *201407190718* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/7495400878cd
User: S. Aubrecht <saubrecht@netbeans.org>
Log: #203979 - no sound when invoking disabled action (on some platforms only)
Comment 32 maetkh 2015-12-08 09:26:17 UTC
If running X, one can use "xset b off" to turn the console beep off system-wide.

Just posted as a solution if somebody reads this, since it seems this beeping "feature" won't be taken away.

Maybe there is some way to disable sound per process or some JRE flags?