Skip to content

Commit

Permalink
gtkui: Hide info area text containing emoji properly. Closes: #1491
Browse files Browse the repository at this point in the history
Fading out text with emoji characters can lead to them still
being displayed above the text of a new track. Ignoring zero
alpha channels avoids this.

Reproduced on Ubuntu 24.04. Arch Linux requires "noto-fonts-emoji".
  • Loading branch information
radioactiveman authored and jlindgren90 committed Oct 21, 2024
1 parent c786e72 commit ac48256
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gtkui/ui_infoarea.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ G_GNUC_END_IGNORE_DEPRECATIONS
static void draw_text (GtkWidget * widget, cairo_t * cr, int x, int y, int
width, float r, float g, float b, float a, int font_size, const char * text)
{
/* The visibility of Unicode characters like emoji is not affected by the
* alpha channel. Make sure to hide them when fading-out track information.
* See also: #1491 */
if (a <= 0)
return;

cairo_move_to (cr, x, y);
cairo_set_source_rgba (cr, r, g, b, a);

Expand Down

0 comments on commit ac48256

Please sign in to comment.