gyunaev / birdtray

new mail system tray notification icon for Thunderbird
GNU General Public License v3.0
782 stars 59 forks source link

Becomes out of sync/unreactive when Thunderbird was opened by notification #571

Open haarp opened 9 months ago

haarp commented 9 months ago

OS: Gentoo Linux Linux Desktop Manager: Xfce (xfce4-notifyd-0.9.1, xfwm4-4.18.0) Birdtray version: 1.11.4 Thunderbird version: 102.15.1 Birdtray origin: Ebuild Qt version: NA

Description When Thunderbird generates a new mail notifcation, it includes an "Activate" button. If the button is pressed, the Thunderbird is raised. In this state, Birdtray does not hide Thunderbird again when clicking on the tray icon. TB needs to be minimized manually first.

Expected behavior Birdtray should always be able to control the TB window

To Reproduce

  1. Enable new mail notifications
  2. Press "Activate" in notification once new mail arrives
  3. Try to hide TB again by clicking on the tray icon

Thanks a lot!

BeatLink commented 7 months ago

Has there been any updates on this?

gyunaev commented 7 months ago

No update since I don't use XFCE. Anyone else using it is invited to troubleshoot what happens in WindowTools_X11::hide() and why it doesn't hide again.

adatum commented 5 months ago

Same issue and workaround with Birdtray 1.11.4 on Fedora 39 and MATE 1.26.2.

jboillot commented 5 months ago

Hello, I had the same issue with Birdtray 1.11.4 on Ubuntu 22.04 and GNOME 42.9.

After some testing, it appears that opening thunderbird via a new message notification does not trigger WindowTools_X11::show, so mHiddenStateCounter is not reset to 0. It implies that the condition of this if statement is false https://github.com/gyunaev/birdtray/blob/62e17bce9b777895ab7d23497351e2409aa37a34/src/windowtools_x11.cpp#L508

According to the few tests I did on my machine, the first term of the disjunction is sufficient and removing the mHiddenStateCounter == 0 test corrects the issue because, once in the tray, the first term becomes false.

However, I don't know if in the general case the second term can be ignored.

haarp commented 5 months ago

@jboillot: Unfortunately can't confirm. I compiled Birdtray without the mHiddenStateCounter check and still couldn't get it to minimize to tray after activating via notification.

tehw0lf commented 3 months ago

@jboillot can confirm, this solves the issue for me (Arch,Xfce 4.18.0,xfce4-notifyd-0.9.4, Birdtray 1.11.4 (self-compiled), TB 115.9.0)

I've opened a PR