Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

birdtray does not detect thunderbird #443

Closed
theguy147 opened this issue Jan 3, 2021 · 19 comments
Closed

birdtray does not detect thunderbird #443

theguy147 opened this issue Jan 3, 2021 · 19 comments
Labels
bug Something isn't working

Comments

@theguy147
Copy link

OS: Manjaro Linux (x86_64 5.10.2-2 Kernel)
WM: LeftWM (bar with systray support: polybar)
Birdtray version: Birdtray version 1.9.0 compiled at Jan 3 2021 22:45:07 using Qt 5.15.2. using Qt 5.15.1
Thunderbird version: Thunderbird 84.0b3 (but same issues also with Thunderbird 78.6.0)
Birdtray origin: compiled from Sources according to README

Description
When starting birdtray thunderbird is started as expected but birdtray does not detect it. Thereby it is not possible to minimize thunderbird to the tray.

Expected behavior
I expected birdtray to detect thunderbird.

To Reproduce

  1. open birdtray

Additional context

$ wmctrl -l
[...]
0x15600010  0 user Inbox - Unified Folders - Mozilla Thunderbird
[...]
$ xprop WM_NAME
WM_NAME(STRING) = "Inbox - Unified Folders - Mozilla Thunderbird"

Thunderbird window name pattern in Advanced settings of Birdtray is set to: "- Mozilla Thunderbird" (and also removing the dash does not work. The window name pattern was copied and pasted to be sure it does not contain different chars)

Birdtray logs (goes on like this forever):

[...]
2021-01-03 23:49:45 Window ID found: 0 
2021-01-03 23:49:45 Starting Thunderbird as '/usr/bin/thunderbird-beta ' 
2021-01-03 23:49:46 Window ID found: 0 
2021-01-03 23:49:46 Window ID found: 0 
2021-01-03 23:49:46 Starting Thunderbird as '/usr/bin/thunderbird-beta ' 
2021-01-03 23:49:47 Window ID found: 0 
2021-01-03 23:49:47 Starting Thunderbird as '/usr/bin/thunderbird-beta ' 
2021-01-03 23:49:48 Window ID found: 0 
2021-01-03 23:49:48 Window ID found: 0 
2021-01-03 23:49:48 Starting Thunderbird as '/usr/bin/thunderbird-beta ' 
[...]
@theguy147 theguy147 added the bug Something isn't working label Jan 3, 2021
@gyunaev
Copy link
Owner

gyunaev commented Jan 3, 2021

xprop _NET_WM_NAME ?

If this one is empty, then LeftWM is not NETWM-compliant. Feel free to change lines 127 and 128 in windowtools_x11.cpp accordingly.

@theguy147
Copy link
Author

theguy147 commented Jan 3, 2021

$ xprop _NET_WM_NAME 
_NET_WM_NAME(UTF8_STRING) = "Inbox - Unified Folders - Mozilla Thunderbird"

LeftWM is EWMH/NETWM compliant according to the github page

@gyunaev
Copy link
Owner

gyunaev commented Jan 3, 2021

Interesting. Can you add the line 165 in windowtools_x11.cpp right behind the // sheer desperation:

// sheer desperation
Log::debug( "windows name '%s' vs '%s' ", qPrintable( getWindowName( display, w ), qPrintable(ename) );

and recompile it and see what we see there?

@theguy147
Copy link
Author

I guess you forgot a bracket there:

// sheer desperation
Log::debug( "windows name '%s' vs '%s' ", qPrintable( getWindowName( display, w )), qPrintable(ename) );

took me a second to realize it...

Here is the log output. I censored not relevant output (where it tried to match other programs I have running.):

2021-01-04 00:46:22 Window ID found: 0 
[...]
2021-01-04 00:46:23 windows name '' vs 'Mozilla Thunderbird'  
2021-01-04 00:46:23 windows name '' vs 'Mozilla Thunderbird'  
2021-01-04 00:46:23 windows name '' vs 'Mozilla Thunderbird'  
[...]
2021-01-04 00:46:23 windows name 'Inbox - Unified Folders - Mozilla Thunderbird' vs 'Mozilla Thunderbird'  
2021-01-04 00:46:23 windows name 'Thunderbird' vs 'Mozilla Thunderbird'  
2021-01-04 00:46:23 windows name 'Thunderbird' vs 'Mozilla Thunderbird'  
[...]
2021-01-04 00:46:23 Window ID found: 0 

@gyunaev
Copy link
Owner

gyunaev commented Jan 3, 2021

Seem to detect it, meaning it later rejects it in a normalcy check. Can you now change the line 376 (in the original file) as following:

- mWinId = findWindow(QX11Info::display(), QX11Info::appRootWindow(), true,
+ mWinId = findWindow(QX11Info::display(), QX11Info::appRootWindow(), false,

(i.e. change the last argument true -> false) and give it a try?

@theguy147
Copy link
Author

wow, that did the trick. works now!
thank you very much for the very quick and very good support!!! :)

@gyunaev
Copy link
Owner

gyunaev commented Jan 4, 2021

Good. Now let's figure out why it is not normal. Can you please check the following fields:

  • _NET_WM_STATE
  • _NET_WM_STATE_MODAL
  • _NET_WM_WINDOW_TYPE
  • _NET_WM_WINDOW_TYPE_NORMAL
  • _NET_WM_WINDOW_TYPE_DIALOG

I suspect LeftWM might not be fully compliant; let's see where.

@theguy147
Copy link
Author

theguy147 commented Jan 4, 2021

that probably should look different?

$ xprop _NET_WM_STATE
_NET_WM_STATE:  not found.

$ xprop _NET_WM_STATE_MODAL             
_NET_WM_STATE_MODAL:  not found.

$ xprop _NET_WM_STATE_MODAL                   
_NET_WM_STATE_MODAL:  not found.

$ xprop _NET_WM_WINDOW_TYPE_NORMAL                   
_NET_WM_WINDOW_TYPE_NORMAL:  not found.

$ xprop _NET_WM_WINDOW_TYPE_DIALOG 
_NET_WM_WINDOW_TYPE_DIALOG:  not found.

EDIT: just to be complete. I forgot _NET_WM_WINDOW_TYPE which actually yields something for a change:

$ xprop _NET_WM_WINDOW_TYPE       
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL

@gyunaev
Copy link
Owner

gyunaev commented Jan 4, 2021

Yep. Unfortunately LeftWM isn't fully compliant with NETWM.

@theguy147
Copy link
Author

Could you please show me how the results for the above commands should look like so I can report this upstream?
thank you very much!

@gyunaev
Copy link
Owner

gyunaev commented Jan 4, 2021

_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ

The window types should be only set for modals. You will see the effect of this when Birdtray gonna hide Thunderbird popup dialogs.

@gyunaev gyunaev closed this as completed in ff65c93 Jan 4, 2021
@gyunaev gyunaev reopened this Jan 4, 2021
@gyunaev
Copy link
Owner

gyunaev commented Jan 4, 2021

I've added an advanced setting to ignore it, please check.

@theguy147
Copy link
Author

yes, this solves it. thank you again.

@theguy147
Copy link
Author

just as a follow up in case anybody ever stumbles upon this for leftwm here and to be complete:

leftwm actually does set _NET_WM_STATE as stated in the EWMH specs but only once a hint was added and not before. This case is actually not covered by the specs and therefore one could say that leftwm is compliant allthough it would be "nicer" if applications don't need to check the property to be set.

here are the steps to reproduce these findings:

1.) start application e.g. firefox normally (not maximized or anything)
2.) check _NET_WM_STATE of application with xprop (and click on application window)

$ xprop _NET_WM_STATE
_NET_WM_STATE:  not found.

3.) enable fullscreen for application
4.) disable fullscreen for application
5.) check _NET_WM_STATE of application with xprop (and click on application window)

$ xprop _NET_WM_STATE
_NET_WM_STATE(ATOM) =

now the property is set but empty as it should be. and also checking the property while e.g. being in fullscreen returns _NET_WM_STATE_FULLSCREEN as it should.

@gyunaev
Copy link
Owner

gyunaev commented Jan 4, 2021

When you maximize the window, doesn't it set _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ?

And what about _NET_WM_WINDOW_TYPE?

@theguy147
Copy link
Author

as far as I know leftWM doesnt have a "maximization" feature and therefore _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ are not really used from the wm but can be enabled/disabled/toggled manually using wmctrl.

and the _NET_WM_WINDOW_TYPE is being set. Sorry I might have created some confusion before because I edited the post above a few minutes after writing them but you must not have seen my edit. this was the result:

$ xprop _NET_WM_WINDOW_TYPE       
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL

@gyunaev
Copy link
Owner

gyunaev commented Jan 4, 2021

Interesting; the presence of window type and the net state should be enough for birdtray.

@lakomyt
Copy link

lakomyt commented May 4, 2022

I have a similar issue, wmctrl -l doesn't show thunderbird. xprop WM_NAME doesn't let me click thunderbird window, I am using wayland.

@metaMMA
Copy link

metaMMA commented Sep 4, 2023

I have a similar issue, wmctrl -l doesn't show thunderbird. xprop WM_NAME doesn't let me click thunderbird window, I am using wayland.

Same issue here with the same results you are seeing with those two commands.

:~$ uname -a
Linux user-HP-Z420 5.19.0-46-generic #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jun 21 15:35:31 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy
:~$ thunderbird --version
 Thunderbird 102.15.0
:~$ birdtray --version
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
birdtray 1.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants