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 445659 - Displays & as & in libnotify notification area song notifications
Displays & as & in libnotify notification area song notifications
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: User Interface
0.10.0
Other All
: Normal trivial
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
: 422065 500285 511963 550455 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-06-09 02:25 UTC by VF
Modified: 2008-09-02 13:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rb-dont-escape-primary-in-nots.patch (1.40 KB, patch)
2007-10-11 15:15 UTC, Bastien Nocera
committed Details | Review
rb-dont-escape-primary-in-nots-2.patch (2.51 KB, patch)
2007-10-26 09:19 UTC, Bastien Nocera
committed Details | Review

Description VF 2007-06-09 02:25:21 UTC
Please describe the problem:
Should display & cleanly

Steps to reproduce:
1. Play a song with & in the title while rhythmbox is hidden in the notif. area


Actual results:
See Something & Something

Expected results:
Should see Something & Something

Does this happen every time?
Yes

Other information:
Shows fine elsewhere in the UI
Comment 1 Jonathan Matthew 2007-06-09 03:18:09 UTC
What version of libnotify are you using?  '&' and various other characters appear correctly for me with libnotify 0.4.x.
Comment 2 VF 2007-06-09 03:31:41 UTC
0.4.4-2 on Fedora 7

Running the command "notify-send "Test & test"" results in a notification being displayed with & correctly, so I doubt it's a libnotify issue.

This does happen for multiple unique songs with titles having '&' in them.
Comment 3 Jonathan Matthew 2007-06-09 03:53:35 UTC
Actually, I think this is a notification-daemon theme bug.  The 'standard' theme passes the notification text unmodified to gtk_label_set_markup, but the 'bubble' theme runs it through g_markup_escape_text.
Comment 4 VF 2007-06-09 04:03:45 UTC
Ah, okay, I see that "Rewrite the Bubble theme" is a task on notification-daemon's  trac http://trac.galago-project.org/ticket/52 , I'll make a note of this there, thanks
Comment 5 Matthias Clasen 2007-10-02 15:14:29 UTC
Actually, this is rhythmboxes fault. 

The notification spec explicitly supports markup in the body, but not in the summary.
Comment 6 Bastien Nocera 2007-10-02 15:35:56 UTC
Spec is at:
http://www.galago-project.org/specs/notification/0.9/x161.html

Not great, but I guess it explains what it does. So no markup, but that wouldn't fix the default theme.
Comment 7 Jonathan Matthew 2007-10-05 09:26:45 UTC
*** Bug 422065 has been marked as a duplicate of this bug. ***
Comment 8 Bastien Nocera 2007-10-11 15:15:43 UTC
Created attachment 97067 [details] [review]
rb-dont-escape-primary-in-nots.patch

Don't escape the primary text, as per the spec.
Comment 9 Bastien Nocera 2007-10-11 15:27:15 UTC
The notification-daemon patch for the standard theme is at:
http://cvs.fedoraproject.org/viewcvs/rpms/notification-daemon/devel/notification-daemon-0.3.7-summary-markup.patch?view=markup

The bubble theme already escapes the text as it should.
Comment 10 Jonathan Matthew 2007-10-25 13:42:10 UTC
This is obviously correct, and I'm apparently some kind of bonehead for not reading the spec.  Thanks.
Comment 11 Bastien Nocera 2007-10-25 13:51:14 UTC
2007-10-25  Bastien Nocera  <hadess@hadess.net>

        * shell/rb-shell.c: (rb_shell_construct_notify_titles):
        Don't escape the primary text for the notification popup, as the
        spec says we shouldn't, fix "&amp;" showing up in the notification
        popup (Closes: #445659)
Comment 12 Alex Lancaster 2007-10-26 03:22:55 UTC
Unfortunately this has the side-effect that the title now disappears (or doesn't change from the previous track if there was a previous track played) in the tooltip when you mouse over the rhythmbox icon in the panel, with the warning message:

 Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Error on line 1: Character ' ' is not valid at the start of an entity name; the & character begins an entity; if this ampersand isn't supposed to be an entity, escape it as &amp;

There needs to be some way to distinguish between the text for the notification and the text for the tooltip.
Comment 13 Bastien Nocera 2007-10-26 09:19:25 UTC
(In reply to comment #12)
> Unfortunately this has the side-effect that the title now disappears (or
> doesn't change from the previous track if there was a previous track played) in
> the tooltip when you mouse over the rhythmbox icon in the panel, with the
> warning message:
> 
>  Gtk-WARNING **: Failed to set text from markup due to error parsing markup:
> Error on line 1: Character ' ' is not valid at the start of an entity name; the
> & character begins an entity; if this ampersand isn't supposed to be an entity,
> escape it as &amp;
> 
> There needs to be some way to distinguish between the text for the notification
> and the text for the tooltip.

Good catch. Does this work for you?
Comment 14 Bastien Nocera 2007-10-26 09:19:56 UTC
Created attachment 97894 [details] [review]
rb-dont-escape-primary-in-nots-2.patch
Comment 15 Jonathan Matthew 2007-10-29 11:26:28 UTC
That fixes it for me.
Comment 16 Bastien Nocera 2007-10-29 13:07:16 UTC
2007-10-29  Bastien Nocera  <hadess@hadess.net>

        * shell/rb-shell.c: (rb_shell_playing_entry_changed_cb),
        (rb_shell_player_window_title_changed_cb):
        * shell/rb-tray-icon.c: (rb_tray_icon_set_tooltip_primary_text):
        * shell/rb-tray-icon.h: Fix escaping of tooltips (Closes: #445659)
Comment 17 Bastien Nocera 2007-11-28 22:32:11 UTC
See also http://bugzilla.gnome.org/show_bug.cgi?id=498081#c5
Comment 18 Bastien Nocera 2007-11-28 22:33:15 UTC
*** Bug 500285 has been marked as a duplicate of this bug. ***
Comment 19 Bastien Nocera 2008-01-25 11:30:43 UTC
*** Bug 511963 has been marked as a duplicate of this bug. ***
Comment 20 Bastien Nocera 2008-09-02 13:12:20 UTC
*** Bug 550455 has been marked as a duplicate of this bug. ***