Synchronizing _NET_WM_STATE writes and reads

Dirk Thierbach dthierbach at
Fri Nov 9 05:01:21 PST 2007

On Fri, Nov 09, 2007 at 12:09:41PM +0100, Matthias Käppler wrote:
> thanks a lot for your valuable input. The more I think about it, the less
> does it seem to be an issue for us anyway, since instantaneous calls to
> changing a window's visibility and then reading its states again is very
> unlikely to happen in the deployed environment. I just stumbled across this
> behavior when running a unit test where I do something like this:

> 1. set some visibility state, e.g. maximize a window
> 2. read the states the WM set for this window
> 3. assert that the proper states are set for this window

Then just rewrite the test:

3a. Wait for Property change notify event
3b. Assert that the proper states are set.

And do it the same way in any non-testing code that uses it. Or, even
better, just react to the event, and never wait for it. If the WM
chooses to ignore your request, that's the proper way to do it.

X is different in this respect to Windows: The WM (and, through it,
the user) sets the policy, not your program.

For example, I personally would *hate* any application that would
force maximised windows onto my desktop. The applications should do what 
I tell them, and not the other way around :-)

- Dirk

More information about the xorg mailing list