After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662591 - can't use backspace in typeahead (goes back one folder)
can't use backspace in typeahead (goes back one folder)
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: File and Folder Operations
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 663947 664499 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-10-24 10:02 UTC by Matthias
Modified: 2012-08-26 14:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch which fixes/works around the issue (1.51 KB, patch)
2011-10-27 19:00 UTC, Chow Loong Jin
none Details | Review
Fixed patch that does not cause compilation errors (1.61 KB, patch)
2011-10-27 19:51 UTC, Chow Loong Jin
none Details | Review
Patch that forwards events to the correct widget (1.62 KB, patch)
2011-11-02 01:32 UTC, Chow Loong Jin
none Details | Review

Description Matthias 2011-10-24 10:02:54 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.
Comment 1 Chow Loong Jin 2011-10-27 16:59:18 UTC
It happens in Metacity too. Seems like a Nautilus issue.
Comment 2 Chow Loong Jin 2011-10-27 17:57:31 UTC
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.
Comment 3 Chow Loong Jin 2011-10-27 19:00:31 UTC
Created attachment 200129 [details] [review]
Patch which fixes/works around the issue

This is a patch which works around the whole focusing issue.
Comment 4 Chow Loong Jin 2011-10-27 19:51:26 UTC
Created attachment 200133 [details] [review]
Fixed patch that does not cause compilation errors
Comment 5 Chow Loong Jin 2011-11-02 01:32:30 UTC
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.
Comment 6 Cosimo Cecchi 2011-11-21 23:15:52 UTC
*** Bug 664499 has been marked as a duplicate of this bug. ***
Comment 7 Cosimo Cecchi 2011-11-21 23:18:16 UTC
*** Bug 663947 has been marked as a duplicate of this bug. ***
Comment 8 Nelson Benitez 2011-11-29 20:09:01 UTC
Is possible that the root of this bug also causes bug 664573 ?
Comment 9 Nelson Benitez 2011-12-13 09:29:45 UTC
I've been unable to reproduce this bug in nautilus master on fedora 16..
Comment 10 Chow Loong Jin 2011-12-14 05:22:47 UTC
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.
Comment 11 Chow Loong Jin 2011-12-14 05:22:47 UTC
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.
Comment 12 William Jon McCann 2012-08-26 14:47:31 UTC
I don't think this affects master.