GNOME Bugzilla – Bug 452067
Beeps when pressing backspace to go up
Last modified: 2007-10-03 14:43:05 UTC
When you press backspace to go up a level, Nautilus emits a system beep. This is superfluous and annoying. Using gtk 2.11.4-0ubuntu1 and nautilus 1:2.19.4-0ubuntu1.
The bug has also been submitted on https://bugs.launchpad.net/bugs/146428 "Binary package hint: nautilus To reproduce: Go to the desktop. Create an empty file. delete it by selecting it with the mouse and deleting it with the keyboard. You hear a system beep. This is a fresh pristine copy of Gutsy Beta. Not very important, but one of the little wrinkles that need ironing."
Personally I was really bugged by that behaviour and I've tried to investigate it and produce a fix. I've not written any serious C code in ages and never developed with GTK, so the fix might be way of, but it works for me. The problem seems to be that nautilus tries to active the search entry box for every key pressed except for a limited set. Backspace and Delete are not in this set, so they activate the search window, which then tries to consume the key press and beeps because Backspace and Delete are not valid actions on a currently empty entry box. My fix simply won't forward BackSpace and Delete to the Searchentry. Backspace and Delete still seem to work correctly once the search entry is open, since then the search entry itself has the focus and its key-handling routine will be called (and not the one in nautilus-icon-container.c that I modified).
Created attachment 96567 [details] [review] my attempts at a fix
Doesn't that mean you can't backspace in the typeahead search?
@Reply #4: That's a valid concern and since I know so little of GTK+ I was afraid that it was so. But it seems that once the typeahead search entry box is shown it receives the focus and thus its key pressed handler is called before any other and correctly handles the keys. It correctly deletes characters with Backspace and Delete and correctly beeps when it's not possible (i.e. no more characters before or after the cursor position).
Thank you for your work, the patch works correctly and alex approved it on IRC, I've commited to trunk and gnome-2-20 2007-10-03 Sebastien Bacher <seb128@ubuntu.com> * libnautilus-private/nautilus-icon-container.c: (key_press_event): patch from Joachim Sauer, fix beep when backspace or delete are pressed (#452067)