Betterbird / thunderbird-patches

Betterbird is a fork of Mozilla Thunderbird. Here are the patches that provide all the goodness.
Other
424 stars 18 forks source link

Global Menu #297

Closed gleyconJ closed 2 months ago

gleyconJ commented 2 months ago

Hello Betterbird team! All right with you?

I would like to know if you are going to implement Betterbird's ability to have the Menu work in the same way as the applications within the Apple system, or, as we know in the KDE universe, the AppMenu.

There is a modified Tunderbird package that works like this.

Here's where it can be seen:

https://aur.archlinux.org/packages/thunderbird-globalmenu

I am awaiting your response.

I just haven't migrated to Betterbird yet because it doesn't have the menu.

AND CONGRATULATIONS, your work has greatly improved Thunderbird.

Betterbird commented 2 months ago

Looks like the same as issue #32 and issue #171.

gleyconJ commented 2 months ago

It would be a change that would open many more doors to freedom and interpersonal use between each type of user.

I'm not trying to force things and such, but 90% of the time a common user asks to add a feature (which is not in the creator's own plans), what he receives is always a NO. Betterbird itself is an answer to the Thunderbird developers' "NO".

See this image from your website.

https://www.betterbird.eu/media/img/tb-bb-comparison-800px.jpg

I think it is a symbol of the happiness of free users. Adding this feature will make Betterbird 100% compatible with any Linux distro.

I would like you to reflect a little on this observation of mine. Your work is already great, why not make it even better?

As it is, without the ability to migrate the global menu to the bar, it appears that it is a buggy application in Interfaces that make use of Global Menus.

Sorry, but I'm not a programmer. Just a user with good intentions.

Betterbird commented 2 months ago

We appreciate the comment. However, Linux is already a terrible zoo. There are different distros, there is FlatPak, there are differences between Wayland and no-Wayland, there are different desktops. It's a nightmare to maintain. And now yet another variation? Looking at https://aur.archlinux.org/packages/thunderbird-globalmenu, they are applying some additional patches, especially the so-called "unity menubar" patch (https://aur.archlinux.org/cgit/aur.git/tree/unity-menubar.patch?h=thunderbird-globalmenu). Apparently there is pref "ui.use_unity_menubar" that drives the behaviour.

The other ones are patches taken from later Mozilla versions: https://phabricator.services.mozilla.com/D187418 https://phabricator.services.mozilla.com/D187749 and https://aur.archlinux.org/cgit/aur.git/tree/assert.patch?h=thunderbird-globalmenu doesn't look like it's necessary, it suppresses a compile error that is best fixed differently.

We can apply the patches and see what happens.

Betterbird commented 2 months ago

We can apply the patches and see what happens.

Try this: http://www.betterbird.eu/downloads2/betterbird-115.10.0-bb27-unity-patch.en-US.linux-x86_64.tar.bz2

On our Linux Mint with Xfce the menu hasn't moved to the top, even with ui.use_unity_menubar set to true.

Betterbird commented 2 months ago

@ gleyconJ: Can you please test the version we've built for you. We'll be building 115.11.0 soon and need to know whether to include the fix or not.

detiam commented 2 months ago

We can apply the patches and see what happens.

Try this: http://www.betterbird.eu/downloads2/betterbird-115.10.0-bb27-unity-patch.en-US.linux-x86_64.tar.bz2

On our Linux Mint with Xfce the menu hasn't moved to the top, even with ui.use_unity_menubar set to true.

Can confirm work here, but the window button disappeared: picture may need this patch: fis-csd-global-menu.patch

Betterbird commented 2 months ago

Thanks, that's a patch for Firefox/Waterfox, it would have to be adapted to BB.

Can you place this CSS into your userChrome.css the chrome directory in your profile and set pref toolkit.legacyUserProfileCustomizations.stylesheets to true:

@media (-moz-platform: linux) {
    *|*:root[shellshowingmenubar="true"]
    #toolbar-menubar[autohide="true"]:not([inactive]) + #TabsToolbar > .titlebar-buttonbox-container {
      visibility: visible !important;
    }
}
detiam commented 2 months ago

Thanks, that's a patch for Firefox/Waterfox, it would have to be adapted to BB.

Can you place this CSS into your userChrome.css the chrome directory in your profile and set pref toolkit.legacyUserProfileCustomizations.stylesheets to true:

@media (-moz-platform: linux) {
    *|*:root[shellshowingmenubar="true"]
    #toolbar-menubar[autohide="true"]:not([inactive]) + #TabsToolbar > .titlebar-buttonbox-container {
      visibility: visible !important;
    }
}

No effect, seems it can't work this way, and there's another patch from old firefox-appmenu AUR package : https://aur.archlinux.org/cgit/aur.git/tree/fix_csd_window_buttons.patch?h=firefox-appmenu that can resolve this issue too.


btw, the unity-menubar.patch is actually from Ubuntu-Unity team https://askubuntu.com/a/1174893, and it's a very old patch that doesn't support Wayland at all. Recently, Mozilla decides to support global menu in Firefox with Wayland support, so the global menu feature may be officially supported in TB 125 or 126 release, then we don't need this patch anymore.

Betterbird commented 2 months ago

Thanks for the information, the CSS from the AUR repo appears to be the same:

 #toolbar-menubar[autohide=true]:not([inactive]) + #TabsToolbar > .titlebar-buttonbox-container {
-  visibility: hidden;
+  visibility: visible;
 }

just without the !important. Well, and they have autohide=true without the quotes.

You could also use the Inspector in the Developer's Toolbox to check which CSS applies to the "windows buttons" here: image

It's the titlebar-buttonbox-container: image as you can see in the CSS.

Does this CSS work in userChrome.css? Looks like there is no #TabsToolbar in BB/TB and .titlebar-buttonbox-container is not inside #toolbar-menubar. So try:

@media (-moz-platform: linux) {
    *|*:root[shellshowingmenubar="true"]
    #unifiedToolbarContainer .titlebar-buttonbox-container {
      visibility: visible !important;
    }
}
detiam commented 2 months ago

Thanks for the information, the CSS from the AUR repo appears to be the same:

 #toolbar-menubar[autohide=true]:not([inactive]) + #TabsToolbar > .titlebar-buttonbox-container {
-  visibility: hidden;
+  visibility: visible;
 }

just without the !important. Well, and they have autohide=true without the quotes.

You could also use the Inspector in the Developer's Toolbox to check which CSS applies to the "windows buttons" here: image

It's the titlebar-buttonbox-container: image as you can see in the CSS.

Does this CSS work in userChrome.css? Looks like there is no #TabsToolbar in BB/TB and .titlebar-buttonbox-container is not inside #toolbar-menubar. So try:

@media (-moz-platform: linux) {
    *|*:root[shellshowingmenubar="true"]
    #unifiedToolbarContainer .titlebar-buttonbox-container {
      visibility: visible !important;
    }
}

Thanks, it work! And found what caused it: chrome://messenger/skin/shared/mailWindow1.css 图片 so Linux needs to skip this part too, I guess.

Betterbird commented 2 months ago

Thanks for the feedback, we'll ship it like this then.

Betterbird commented 2 months ago

https://github.com/Betterbird/thunderbird-patches/commit/5ed62d5d38e903265ad2f7da65ddc13993af90d3 sets pref ui.use_unity_menubar to false (so interested users need to set it to true) and adds the CSS in a slightly different form. We'll post a test build here soon.

Betterbird commented 2 months ago

@detiam, please remove the entry from your userChrome.css again and try this build: https://www.betterbird.eu/downloads/LinuxArchive/betterbird-115.11.0-bb28-preview.en-US.linux-x86_64.tar.bz2

detiam commented 2 months ago

@detiam, please remove the entry from your userChrome.css again and try this build: https://www.betterbird.eu/downloads/LinuxArchive/betterbird-115.11.0-bb28-preview.en-US.linux-x86_64.tar.bz2

Peek 2024-05-11 12-46

Works perfectly 🎉

Betterbird commented 2 months ago

Hi @detiam, thanks for testing and for the video. Can you please check what happens with other stand-alone windows that have menus, like the compose/Write window, the OpenPGP key manager or when you create/edit a Calendar event (not in a tab). They maintain their menu?

detiam commented 2 months ago

Hi @detiam, thanks for testing and for the video. Can you please check what happens with other stand-alone windows that have menus, like the compose/Write window, the OpenPGP key manager or when you create/edit a Calendar event (not in a tab). They maintain their menu?

So the patch is too old... The compose/write window works fine, but the OpenPGP key manager lost its menu, and the Calendar New Event window just ignore the pref change:

https://github.com/Betterbird/thunderbird-patches/assets/44510779/4a16fd59-9d29-4d96-9418-d8ea261f88d9

Terminal outputs:

Betterbird: Detected desktop environment kde.

[Parent 219436, Main Thread] WARNING: invalid (NULL) pointer instance: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): GLib-GObject-CRITICAL **: 15:59:25.190: invalid (NULL) pointer instance
[Parent 219436, Main Thread] WARNING: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): GLib-GObject-CRITICAL **: 15:59:25.190: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
[Parent 219436, Main Thread] WARNING: About to Show called on an item wihtout submenus.  We're ignoring it.: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): LIBDBUSMENU-GLIB-WARNING **: 15:59:25.238: About to Show called on an item wihtout submenus.  We're ignoring it.
[Parent 219436, Main Thread] WARNING: About to Show called on an item wihtout submenus.  We're ignoring it.: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): LIBDBUSMENU-GLIB-WARNING **: 15:59:25.238: About to Show called on an item wihtout submenus.  We're ignoring it.
[Parent 219436, Main Thread] WARNING: About to Show called on an item wihtout submenus.  We're ignoring it.: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): LIBDBUSMENU-GLIB-WARNING **: 15:59:26.579: About to Show called on an item wihtout submenus.  We're ignoring it.
[Parent 219436, Main Thread] WARNING: About to Show called on an item wihtout submenus.  We're ignoring it.: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): LIBDBUSMENU-GLIB-WARNING **: 15:59:26.579: About to Show called on an item wihtout submenus.  We're ignoring it.
[Parent 219436, Main Thread] WARNING: About to Show called on an item wihtout submenus.  We're ignoring it.: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): LIBDBUSMENU-GLIB-WARNING **: 15:59:29.391: About to Show called on an item wihtout submenus.  We're ignoring it.
[Parent 219436, Main Thread] WARNING: About to Show called on an item wihtout submenus.  We're ignoring it.: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): LIBDBUSMENU-GLIB-WARNING **: 15:59:30.574: About to Show called on an item wihtout submenus.  We're ignoring it.
[Parent 219436, Main Thread] WARNING: About to Show called on an item wihtout submenus.  We're ignoring it.: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): LIBDBUSMENU-GLIB-WARNING **: 15:59:30.574: About to Show called on an item wihtout submenus.  We're ignoring it.
[Parent 219436, Main Thread] WARNING: About to Show called on an item wihtout submenus.  We're ignoring it.: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): LIBDBUSMENU-GLIB-WARNING **: 15:59:31.994: About to Show called on an item wihtout submenus.  We're ignoring it.
[Parent 219436, Main Thread] WARNING: About to Show called on an item wihtout submenus.  We're ignoring it.: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): LIBDBUSMENU-GLIB-WARNING **: 15:59:31.994: About to Show called on an item wihtout submenus.  We're ignoring it.
[Parent 219436, Main Thread] WARNING: About to Show called on an item wihtout submenus.  We're ignoring it.: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): LIBDBUSMENU-GLIB-WARNING **: 15:59:39.959: About to Show called on an item wihtout submenus.  We're ignoring it.
[Parent 219436, Main Thread] WARNING: About to Show called on an item wihtout submenus.  We're ignoring it.: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): LIBDBUSMENU-GLIB-WARNING **: 15:59:39.959: About to Show called on an item wihtout submenus.  We're ignoring it.
[Parent 219436, Main Thread] WARNING: About to Show called on an item wihtout submenus.  We're ignoring it.: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): LIBDBUSMENU-GLIB-WARNING **: 16:00:03.388: About to Show called on an item wihtout submenus.  We're ignoring it.
[Parent 219436, Main Thread] WARNING: About to Show called on an item wihtout submenus.  We're ignoring it.: 'glib warning', file /home/betterbird/build115/mozilla-esr115/toolkit/xre/nsSigHandlers.cpp:167

(betterbird:219436): LIBDBUSMENU-GLIB-WARNING **: 16:00:03.388: About to Show called on an item wihtout submenus.  We're ignoring it.
Betterbird commented 2 months ago

Thanks for testing. One would have to do a stocktake of all stand-alone windows. Those losing the menu are more problematic than those which don't follow the pref. The are quite a few stand-alone windows, but not all have a menu. I guess TB compiled with global menus has been shipping with these issues for a while.

Betterbird commented 2 months ago

This query gives the windows with menubar: https://searchfox.org/comm-esr115/search?q=toolbar.*menubar&path=.xhtml&case=false&regexp=true

  1. calendar-event-dialog.xhtml --> Calendar event
  2. messageWindow.xhtml --> Single message window, "open message in new window"
  3. messenger.xhtml --> Main window
  4. viewSource.xhtml --> View Source menu
  5. messengercompose.xhtml --> Compose window
  6. enigmailKeyManager.xhtml --> PGP key manager

We already know how 1 (no change), 3 (good), 5 (good) and 6 (losing menu) behave, missing 2 and 4.

Looking at the patch, some menus are "tagged" with _moz-menubarkeeplocal="true". That could be done with at least the non-functioning windows like # 6.

We'll likely install the appropriate Linux to try it ourselves. What's required? Ubuntu with Unity?

detiam commented 2 months ago

We already know how 1 (no change), 3 (good), 5 (good) and 6 (losing menu) behave, missing 2 and 4.

The 2 is good, I don't know how to test 4.

We'll likely install the appropriate Linux to try it ourselves. What's required? Ubuntu with Unity?

Yea, any desktop environment with Global Menu support, for example:

Both of them have Linux recommendation on their website.

Betterbird commented 2 months ago

View Source: Select any message from the list, Ctrl+U. Or: View > Message Source.

Update: We got the Global Menubar working in KDE, "View Source" works. So we'll look into the two that don't work: Calendar and OpenPGP key manager.

Betterbird commented 2 months ago

We've debugged this a bit. Creating the menu bar for the calendar event fails internally, so that would mean debugging the "unity menubar" code, which is out of scope here. The menu for the OpenPGP manager gets created with no errors, however, for some reason, it's not displayed. We will solve both issued with _moz-menubarkeeplocal="true" to keep the menubar local for these dialogs.

Betterbird commented 2 months ago

https://github.com/Betterbird/thunderbird-patches/commit/83819e9a1df8e8e4221c3e5bce5d35492611d5ca We've changed the pref to widget.gtk.global-menu.enabled since this is what the Mozilla folks call it in the current version. The non-working OpenPGP Key Manager and the Calendar event dialogue are now hard-coded not to use the global menu. New build: https://www.betterbird.eu/downloads/LinuxArchive/betterbird-115.11.0-bb28-preview2.en-US.linux-x86_64.tar.bz2

I think we're done here for now.

gleyconJ commented 2 months ago

Hello Betterbird! Sorry for the delay in getting in touch, but since the last time I visited here a lot has happened. And I saw that it was good because maybe I wouldn't be good enough to give you such sensational feedback!

After catching up with everything that happened here I tried clicking on the link. https://www.betterbird.eu/downloads/LinuxArchive/betterbird-115.11.0-bb28-preview2.en-US.linux-x86_64.tar.bz2

But what happened was:


404 - You hate it :-( Try the main page at www.betterbird.eu instead.


The official version of my Arch Linux repository is: 115.10.0-1

Creation Date: Thursday, May 2, 2024 16:58:20 -03

What should I do for me to help with the tests? Wait for a version to be released in the repository? Or do you have another link with the changed version?

Thank you very much for helping us have this fantastic app curated for Global Menus interfaces.

Betterbird commented 2 months ago

The previews have been replaced with the release: https://www.betterbird.eu/downloads/get.php?os=linux&lang=en-US&version=release

Arch will follow in a few days.

gleyconJ commented 1 month ago

Hello, I just updated Betterbird today, through the Arch Linux repository itself.

Version 115.11.0-1

Licenses MPL2

Makes available betterbird=115.11.0

Depends on dbus-glib

Installed Size 236.35 MiB

Packer Unknown Packager

Architecture x86_64

Creation Date Wednesday, May 22, 2024 17:20:55 BRT

Reason for installation Explicitly installed

After updating, nothing happened. However, I went to the following settings:

Go to Edit > Preferences > Advanced > Configuration Editor.

• I searched for widget.gtk.global-menu.enabled.

It was "false", so I turned it to true and restarted Betterbird. The application opened completely broken. After many attempts to use it, I tried restarting the PC to see if it helped. Then when I started again, nothing changed. The application maintained the "broken" state.

But before going to the defect itself, I want to say that when I finished opening the menu, it was suspended to the Global Menu Bar. And it was just beautiful and perfect, and where the menu was, all the Betterbird icons occupied this space. Aesthetically it was perfect. (too bad it's GTK if it were in QT, it would be more than perfect). Anyway, this was just a comment from a user and KDE.

THE DEFECTIVE BEHAVIOR IS THE FOLLOWING: the menu is in the correct location, however, if the mouse points to the menu, it blinks, as if the mouse was pointing in several places at the same time. If I click on the menu, the options go down, but it's as if it wants to jump to the next item, but the mouse pointing doesn't let me, so it keeps blinking. Like I'm in the In files and it wants to jump to Tools, about 5 menus forward, but it goes back to the file menu. This happens in milliseconds. As for the interface, it starts as a black screen, and is assembled little by little, taking more than 10 seconds for each part to be assembled. To have the interface 100% present on the monitor takes more than a minute. Once it assembles itself, if I want to use anything from the interface, it will again take more than a minute to assemble again. Appearing to be in super slow motion. Furthermore, CPU and SSD usage goes up a lot during this process.

With a lot of delay, I managed to do the whole thing in reverse and return Betterbird to widget.gtk.global-menu.enabled (FALSE). When restarted it returned to normal, as if nothing had happened. 100% functional, as it always is.

Did I do something wrong? I can't wait and thank you very much for introducing this new Global Menu feature to Betterbird.

gleyconJ commented 1 month ago

Oh! Another very important thing to say is that I monitored the RAM, and when it was in the BROKEN state, the RAM was around 3GB of use. Now that it is back to normal the RAM has gone to 400MB of use.

Betterbird commented 1 month ago

Well, if you read through the ticket, we "just" applied some old Unity patch. Another person commenting here had more success. Apparently the global menu is already in the current version of Firefox, so maybe a production-strength version will also be in TB/BB.

gleyconJ commented 1 month ago

I looked at some Redit threads and people there were saying that the GTK Global Menu in QT environments are not working well when the system is running on Wayland. Is that what happened? I don't know if this would be the case, as I use other applications also in GTK, such as Gimp and Chromium, and both work 100% with the menu moved to AppMenu.

Betterbird commented 1 month ago

Please read: https://github.com/Betterbird/thunderbird-patches/issues/297#issuecomment-2098821790

There are different distros, there is FlatPak, there are differences between Wayland and no-Wayland, there are different desktops. It's a nightmare to maintain. And now yet another variation?

We adopted the patch, the (faulty) behaviour is switched off by default. Wayland has many more problems. The end.

gleyconJ commented 1 month ago

Hello. I understand you. And you're right comrade.

It must be a nightmare to be compatible with everything in this zoo.

My order was really because I loved Betterbird. I've been a Thundebird user since 2005 (if I remember correctly). And since then I've almost never used another one. Except Outlook in my Windows days (Dual Boot).

I think the right thing for us users is the following:

I mean, if you have to maintain a "cured" system. Do the following: Use GTK in GTK environments (gnome for example). Use QT in QT environments (KDE for example). Use Fluent Design apps for Win10/11 environments.

I'm saying this to myself. LOL

I will continue using Betterbird. But I believe I will have to migrate to another QT client, if I am interested in keeping my workflow "curated".

But thank you very much for trying to make Betterbird better.