Skip to content

Commit

Permalink
Don't set tooltip on Gnome. It's not supported and sometimes crashes.…
Browse files Browse the repository at this point in the history
… (Issue #266)
  • Loading branch information
Betterbird committed Feb 9, 2024
1 parent b6d9d03 commit cf7c513
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
47 changes: 47 additions & 0 deletions 115/features/12a-feature-linux-systray-betterbird.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# HG changeset patch
# Parent 126e11fa50b203f38df270c1f708c3596b95ebe5
Don't set tooltip on Gnome. It's not supported and sometimes crashes.

diff --git a/mailnews/base/src/nsMessengerUnixIntegration.cpp b/mailnews/base/src/nsMessengerUnixIntegration.cpp
--- a/mailnews/base/src/nsMessengerUnixIntegration.cpp
+++ b/mailnews/base/src/nsMessengerUnixIntegration.cpp
@@ -250,28 +250,33 @@ nsMessengerUnixIntegration::UpdateUnread
sTimeActivated.tv_sec--;
}

if (unreadCount > 0) {
const nsCString& tooltip = NS_ConvertUTF16toUTF8(unreadTooltip);
// Set both title and tooltip. It appears that some platforms do
// one but not the other.
app_indicator_set_title(ci, tooltip.get());
- app_indicator_set_tooltip_full(ci,
- NULL /* icon */, tooltip.get() /* title */, NULL /* body */
- );
+ if (!desktop.EqualsLiteral("gnome")) {
+ // Gnome has no tooltips and this call crashes under Wayland :-(
+ app_indicator_set_tooltip_full(ci,
+ NULL /* icon */, tooltip.get() /* title */, NULL /* body */
+ );
+ }
app_indicator_set_icon_full(ci, icon_pathN, NULL);
app_indicator_set_status(ci, APP_INDICATOR_STATUS_ACTIVE);
} else {
if (mozilla::Preferences::GetBool("mail.biff.show_tray_icon_always", false) ||
sHiddenWindows.Length() > 0) {
app_indicator_set_title(ci, "Betterbird");
- app_indicator_set_tooltip_full(ci,
- NULL /* icon */, "Betterbird" /* title */, NULL /* body */
- );
+ if (!desktop.EqualsLiteral("gnome")) {
+ app_indicator_set_tooltip_full(ci,
+ NULL /* icon */, "Betterbird" /* title */, NULL /* body */
+ );
+ }
app_indicator_set_icon_full(ci, icon_path0, NULL);
app_indicator_set_status(ci, APP_INDICATOR_STATUS_ACTIVE);
} else {
app_indicator_set_status(ci, APP_INDICATOR_STATUS_PASSIVE);
}
}

return NS_OK;
1 change: 1 addition & 0 deletions 115/series
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,4 @@ feature-297852-grouping-search-term-disallow-group-after-group.patch
1873353-fix-secondary-sort-by-date-in-grouped-by-sort.patch
## End: The big crash and friends
1863957-fix-slow-eml.patch ## in TB 124
12a-feature-linux-systray-betterbird.patch

0 comments on commit cf7c513

Please sign in to comment.