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 723942 - Search on keypress function opens search bar even when pressing any key (patch)
Search on keypress function opens search bar even when pressing any key (patch)
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-music-maint
gnome-music-maint
Depends on:
Blocks:
 
 
Reported: 2014-02-09 06:57 UTC by Julian Bayardo
Modified: 2014-03-03 10:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes the bug. (5.92 KB, patch)
2014-02-09 06:57 UTC, Julian Bayardo
committed Details | Review
[PATCH] Support different keyboard layouts in search on keypress (1.11 KB, patch)
2014-03-03 02:38 UTC, Anton Belka
needs-work Details | Review
[PATCH] Support different keyboard layouts in search on keypress (1.13 KB, patch)
2014-03-03 10:25 UTC, Anton Belka
committed Details | Review

Description Julian Bayardo 2014-02-09 06:57:03 UTC
Hi. This is a patch in order to fix a bug generated by the resolution of bug 721595 [1], it also fixes the encapsulation problem mentioned in there.

Still, this should be thought of as a temporary fix, since the current way of handling key presses does not make use of Gtk's methods (GtkAccelGroup, etcetera), which might not be a very good idea, considering the code will probably become long and tedious unless the approach is corrected.

I have also changed the names of the functions on_configure_event and on_window_state_event in order to correspond to the (apparent) convention that signal callbacks have a underscore prefixed to their names.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=721595
Comment 1 Julian Bayardo 2014-02-09 06:57:37 UTC
Created attachment 268550 [details] [review]
Fixes the bug.
Comment 2 Vadim Rutkovsky 2014-02-10 14:24:00 UTC
Review of attachment 268550 [details] [review]:

Pushed the fix as https://git.gnome.org/browse/gnome-music/commit/?id=7bd33a3
Comment 3 Vadim Rutkovsky 2014-02-10 14:24:51 UTC
The bug is still not fixed complete however - non-ASCII symbols are skipped, the code uses 'magic' numbers and, as Julian has stated - a temporary solution.

Julian, please use 'git format-patch' further on - it would be a bit more convenient for us to accept your patches
Comment 4 Julian Bayardo 2014-02-11 00:56:11 UTC
As far as I have checked, no other music application manages to receive non-ASCII symbols successfully, probably because of this:

When pressing "a", event.keyval has value 97. When trying to type "á", one presses "'" first, which receives 65105, and then one presses "a", which has value 97. This is displayed in the entry as "á". I'm thinking about how to approach the problem.

If you happen to know whether there is any way to verify whether a character is mapped in unicode, that could come in useful. Oh, and about the patches thing, sure, I though 'git patch' was the most convenient.

Thanks,
Julián.
Comment 5 Anton Belka 2014-03-03 02:38:55 UTC
Created attachment 270743 [details] [review]
[PATCH] Support different keyboard layouts in search on keypress

Hi, Vadim.
I fixed two problems, which you described and right now:
- code don't use magic numbers
- non-ASCII symbols handled
Please review my patch.
Thanks a lot. :)
Comment 6 Vadim Rutkovsky 2014-03-03 09:55:46 UTC
Review of attachment 270743 [details] [review]:

This breaks search by numbers (e.g. 100) also non-ASCII (I tried Russian Cyrillics) don't work for me
Comment 7 Anton Belka 2014-03-03 10:25:50 UTC
Created attachment 270765 [details] [review]
[PATCH] Support different keyboard layouts in search on keypress

Sorry, fixed. :)
Comment 8 Vadim Rutkovsky 2014-03-03 10:30:31 UTC
Review of attachment 270765 [details] [review]:

Thanks, pushed as https://git.gnome.org/browse/gnome-music/commit/?id=41b5941