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 735274 - "Space" isn't working in search
"Space" isn't working in search
Status: RESOLVED FIXED
Product: gnome-software
Classification: Applications
Component: General
3.13.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Software maintainer(s)
GNOME Software maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-08-23 09:58 UTC by alex diavatis
Modified: 2014-09-01 18:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Focus the search entry on keypress (1.49 KB, patch)
2014-09-01 18:24 UTC, Elad Alfassa
accepted-commit_now Details | Review
Focus the search entry on keypress (1.57 KB, patch)
2014-09-01 18:39 UTC, Elad Alfassa
committed Details | Review

Description alex diavatis 2014-08-23 09:58:59 UTC
Reproduce: Always

1. launch Software and start typing
2. focus on search input entry is "lost", although you can still type
3. "Space" for adding multiple terms isn't working

Clicking on search input give focus back and you can add "space"
Comment 1 Elad Alfassa 2014-09-01 09:30:46 UTC
I mentioned it in bug #710640, the correct fix would be focusing the search field when you start typing, it's a very trivial fix, I can make a patch if Kalev approves.
Comment 2 Elad Alfassa 2014-09-01 18:24:42 UTC
Created attachment 285048 [details] [review]
Focus the search entry on keypress

Patch attached.

The trick with the "editable" property is needed because without doing it the text in the entry will be selected when we grab the focus, which will cause your next keystroke to replace what you already wrote, and this is something we really don't want. When setting "editable" to false gtk won't select the text in the entry when we grab the focus.

I'll file a GTK bug later asking for this functionality to be added so that hack won't be needed, but for now I feel it's good enough to fix this bug. fwiw polari uses exactly the same trick, so we are not the only app that would benefit from GTK implementing a method for that.
Comment 3 Kalev Lember 2014-09-01 18:32:22 UTC
Review of attachment 285048 [details] [review]:

Looks good to me, thanks. Just add a source code comment about the editable property trick, please.

::: src/gs-shell.c
@@ +399,3 @@
+	g_object_set (entry, "editable", FALSE, NULL);
+	gtk_widget_grab_focus (entry);
+	g_object_set (entry, "editable", TRUE, NULL);

Would be good if you could add a comment here explaining why this is needed.
Comment 4 Elad Alfassa 2014-09-01 18:39:29 UTC
Created attachment 285050 [details] [review]
Focus the search entry on keypress

Now with a short comment explaining why I'm doing the "editable" thing
Comment 5 Kalev Lember 2014-09-01 18:41:01 UTC
Review of attachment 285050 [details] [review]:

Looks good, thanks.