Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/panel/widgets/notifications/single-notification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "daemon.hpp"

#include <glibmm/main.h>
#include <glibmm/markup.h>
#include <gtk-utils.hpp>
#include <gtkmm/icontheme.h>

Expand Down Expand Up @@ -111,11 +112,12 @@ WfSingleNotification::WfSingleNotification(const Notification & notification)
text.set_line_wrap_mode(Pango::WRAP_CHAR);
if (notification.body.empty())
{
text.set_markup(notification.summary);
text.set_markup(Glib::Markup::escape_text(notification.summary));
} else
{
// NOTE: that is not a really right way to implement FDN markup feature, but the easiest one.
text.set_markup("<b>" + notification.summary + "</b>" + "\n" + notification.body);
text.set_markup("<b>" + Glib::Markup::escape_text(
notification.summary) + "</b>" + "\n" + Glib::Markup::escape_text(notification.body));
}

content.pack_start(text);
Expand Down
11 changes: 7 additions & 4 deletions src/panel/widgets/tray/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <gtk-utils.hpp>

#include <glibmm/markup.h>

#include <gtkmm/icontheme.h>
#include <gtkmm/tooltip.h>

Expand Down Expand Up @@ -185,10 +187,11 @@ void StatusNotifierItem::setup_tooltip()
get_item_property<std::tuple<Glib::ustring, IconData, Glib::ustring, Glib::ustring>>("ToolTip");

auto tooltip_label_text = !tooltip_text.empty() && !tooltip_title.empty() ?
"<b>" + tooltip_title + "</b>: " + tooltip_text :
!tooltip_title.empty() ? tooltip_title :
!tooltip_text.empty() ? tooltip_text :
get_item_property<Glib::ustring>("Title");
"<b>" + Glib::Markup::escape_text(tooltip_title) + "</b>: " +
Glib::Markup::escape_text(tooltip_text) :
!tooltip_title.empty() ? Glib::Markup::escape_text(tooltip_title) :
!tooltip_text.empty() ? Glib::Markup::escape_text(tooltip_text) :
Glib::Markup::escape_text(get_item_property<Glib::ustring>("Title"));

const auto pixbuf = extract_pixbuf(std::move(tooltip_icon_data));

Expand Down