X Tutup
The Wayback Machine - https://web.archive.org/web/20210106130909/https://github.com/python-xlib/python-xlib/issues/113
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

Can't seem to detect any _NET_WM_STATE_DEMANDS_ATTENTION except on urxvt windows #113

Open
slackhead opened this issue Apr 9, 2018 · 0 comments

Comments

@slackhead
Copy link

@slackhead slackhead commented Apr 9, 2018

Hi

I'm detecting _NET_WM_STATE_DEMANDS_ATTENTION in _NET_WM_STATE and it works fine if I make a bell character in a rxvt-uncode terminal for example. However if I set the flag on other windows it isn't detected, even though xprop sees it. So far I've tried it on a few web browsers and clementine.

self._CLIENT_LIST = dsp.intern_atom("_NET_CLIENT_LIST")
self._STATE = dsp.intern_atom("_NET_WM_STATE")
self._URGENT = dsp.intern_atom("_NET_WM_STATE_DEMANDS_ATTENTION")
tasks = root.get_full_property(self._CLIENT_LIST, Xatom.WINDOW).value

for task in list(tasks):
	obj = dsp.create_resource_object("window", task)

	try:
		props = obj.get_full_property(self._STATE, Xatom.ATOM)
		if props:
			if self.get_name(obj) == "Clementine":     
				print(props)
	except:
		continue

The above will output:

<<class 'Xlib.protocol.request.GetProperty'> serial = 95, data = {'sequence_number': 95, 'property_type': 4, 'bytes_after': 0, 'value': (32, array('I', [867]))}, error = None>

As you see it only has one property value: 867, but using xprop on it shows:

wmctrl -l:
0x02c00007  3 raven Clementine

xprop -id  0x02c00007 | grep -i atten
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_DEMANDS_ATTENTION

I've just updated to the latest python-xlib to see if it works better than my
old version but it still doesn't detect it.

python-xlib-0.23
libX11-1.6.4

Any ideas?

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.
X Tutup