GNOME Bugzilla – Bug 662591
can't use backspace in typeahead (goes back one folder)
Last modified: 2012-08-26 14:47:31 UTC
I type to search in a folder, I type the first few letters »abc«, I see I made a mistake, I press backspace and nautilus goes a folder »back«. When I press escape to start over, it continues my first search. »abc« + backspace –> back »abc« + esc + »abd« –> »abcabd« I am using Nautilus in Unity – so this could be a source of the mistake, too.
It happens in Metacity too. Seems like a Nautilus issue.
Okay, here's a brain-dump of what I've figured out so far. It seems that the search_entry gets focused (at least, gdb says so), but apparently so does the nautilus_icon_container. Just before this line: /* We pass the event to the search_entry. If its text changes, then we I put a breakpoint, and had gdb print out two things: p gtk_widget_has_focus(widget) p gtk_widget_has_focus(container->details->search_entry) And it looks like the first keypress has widget focused but search_entry not, but the second keypress onwards has *both* focused. Very weird. Additionally, the key press events seem to go straight into the nautilus_icon_container, rather than into search_entry, and these get processed weirdly, backspaces among other things filtered, and then get forwarded into the search_entry inside that little if block after the aforementioned comment. (if (!handled && ...). That probably should not happen, and it looks like key press events are supposed to go straight into the search_entry.
Created attachment 200129 [details] [review] Patch which fixes/works around the issue This is a patch which works around the whole focusing issue.
Created attachment 200133 [details] [review] Fixed patch that does not cause compilation errors
Created attachment 200469 [details] [review] Patch that forwards events to the correct widget Looks like I should have forwarded the event to search_window instead of search_entry. This fixes the case with the escape key as well, which didn't work with the previous patch.
*** Bug 664499 has been marked as a duplicate of this bug. ***
*** Bug 663947 has been marked as a duplicate of this bug. ***
Is possible that the root of this bug also causes bug 664573 ?
I've been unable to reproduce this bug in nautilus master on fedora 16..
I don't think bug 664573 is the same issue. That bug seems to be about events being delivered to the wrong widget in the same window, whereas this bug is about events being delivered to the main window instead of the typeahead window because the focus isn't transferred properly to the typeahead window (which is actually a separate toplevel window). In the case of this bug, it might actually be related to the focus-prevention and focus-follows-mouse handling of some window managers, but I'm unsure of the specifics. The patch I have attached has been applied in Ubuntu (see https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/879456) and has been working well for a number of people.
I don't think this affects master.