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

Empty chromium and chrome get_wm_name. #15

Open
unai-ndz opened this issue Jun 16, 2018 · 2 comments
Open

Empty chromium and chrome get_wm_name. #15

unai-ndz opened this issue Jun 16, 2018 · 2 comments

Comments

@unai-ndz
Copy link

If I run this:

from ewmh import EWMH

ewmh = EWMH()
windows = ewmh.getClientList()

for w in windows:
    # Window name (Title)
    print(w.get_wm_name())
    print(w.get_wm_class()[1])

I get:

Chromium

Google-chrome
Terminal
Xfce4-terminal
~/gits/test_ewmh/test.py (i3close) - Sublime Text
Sublime_text

While running:
xprop | grep WM_NAME
Outputs:

WM_NAME(UTF8_STRING) = "New Issue · parkouss/pyewmh - Chromium"
_NET_WM_NAME(UTF8_STRING) = "New Issue · parkouss/pyewmh - Chromium"

and

WM_NAME(UTF8_STRING) = "duckduckgo at DuckDuckGo - Google Chrome"
_NET_WM_NAME(UTF8_STRING) = "duckduckgo at DuckDuckGo - Google Chrome"

I have tested this on a new pypenv with ewmh-0.1.6, python-xlib-0.23, six-1.11.0 and Python 3.6.5
I can't test this on others environments or browsers right now, but maybe I'm doing something wrong.
Did you have any idea or want more info?

@creallfluharty
Copy link

creallfluharty commented Jun 9, 2020

(Not involved in this project, just thought I'd comment) Though I can't speak to why get_wm_name() is empty (beyond the possibility that it may just be unset), if you didn't know already, in order to get _NET_WM_NAME (rather than _WM_NAME) you can use EWMH.getWmName, like:

from ewmh import EWMH

ewmh = EWMH()
windows = ewmh.getClientList()

for w in windows:
    # Window name (Title)
    print(ewmh.getWmName(w))
    print(w.get_wm_class()[1])

Just pure speculation, but I wonder if xprop would use _NET_WM_NAME as a fallback, given that - at least on my machine - WM_NAME is usually of type STRING, rather than UTF8_STRING

In any case, I believe the get_wm_name method is actually a method of python-xlib's Window (see here), so this problem may be entirely outside of pyewmh's control.

@MestreLion
Copy link

Indeed, Window.get_wm_name() is from python-xlib, and it reads the WM_NAME property. It is empty because of bug python-xlib/python-xlib#212

To get the (preferred) _NET_WM_NAME property, use emwh.EWMH.getWmName(window) as @creallfluharty suggested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants