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

awesome.restart kills _NET_WM_CM property #419

Closed
timroes opened this issue Aug 18, 2015 · 10 comments
Closed

awesome.restart kills _NET_WM_CM property #419

timroes opened this issue Aug 18, 2015 · 10 comments

Comments

@timroes
Copy link
Contributor

timroes commented Aug 18, 2015

It seems, that restarting awesome via awesome.restart() resets a _NET_WM_CM property a compositor have set beforehand.

If I start compton via my config and with the flag -b it runs as a daemon in background; awesome.composite_manager_running will return true from now on.

If you now restart awesome compton keeps running (and working), but awesome.composite_manager_running will return false after the restart.

A simple workaround is to kill compton and start it every time awesome comes up, but it would be nicer if I could just start it once and it will keep the _NET_WM_CM property over an awesome restart.

I am not much into xcb so I don't know if this behavior is intentional or is a side effect of any of the xcb methods during awesome_atexit or the startup phase. Do you have any ideas about that?

@blueyed
Copy link
Member

blueyed commented Aug 18, 2015

Reminds me of #181 (but not really related).

It needs maybe the same handling as in 4aa6c33 - remembering this across restarts.

@timroes
Copy link
Contributor Author

timroes commented Aug 19, 2015

Just out of curiosity what exactly loses the variable? Is the storage of that kind of variable in X linked to the running WM or is it a side effect of one of the methods used during cleanup?

@blueyed
Copy link
Member

blueyed commented Aug 19, 2015

Probably the former, but I do not know.

@blueyed
Copy link
Member

blueyed commented Aug 19, 2015

Reading http://standards.freedesktop.org/wm-spec/1.4/ar01s08.html reminds me again of #181..

@psychon
Copy link
Member

psychon commented Aug 22, 2015

I don't really agree with your theories, sorry.

Here is mine:
@timroes run_once doesn't really work and when he restarts awesome, the new awesome starts a new compton instance. Looking at compton's source code, I think that it registers itself for _NET_CM_Sn before checking if another composite manager is already running. So when a second compton starts, it gets the _NET_CM_Sn selection, then gets an error from the X11 server telling it that it cannot become the composite manager, then it exits ( https://github.com/chjj/compton/blob/master/src/compton.c#L3321-L3325 ). This will destroy the window used for registering the selection and thus the _NET_CM_Sn selection becomes unowned.

@timroes Could you start compton from a terminal while awesome is running and another compton is already running, tell me which error message it prints and if this then causes awesome.composite_manager_running to become false?

If this really explains the problem, then compton should follow ICCCM with its selection:

  • It should not just blindly acquire the selection, but check if the selection is already owned first (and then exit with an error, if needed)
  • When it loses the selection, it should exit according to ICCCM

As @blueyed already found in EWMH:

For each screen they manage, compositing manager MUST acquire ownership of a selection named _NET_WM_CM_Sn, where n is the screen number. Compositing managers MUST comply with the conventions for "Manager Selections" described in section 2.8 of the [ICCCM].

@timroes
Copy link
Contributor Author

timroes commented Aug 22, 2015

@psychon You were right about your assumption. compton exits with "Another composite manager is already running" and awesome.composite_manager_running will switch to you false from that on.

So compton should fix it, but looking at their "most recent" release history I will likely not rely on a new release there and since I am anyway refactoring large parts of my config I was anyway going to write a proper functioning run_once method.

@timroes timroes closed this as completed Aug 22, 2015
@blueyed
Copy link
Member

blueyed commented Aug 22, 2015

@timroes

proper functioning run_once method

Why not just use ~/.xsessionrc for this?
I have been using a run_once method myself, but migrated in the meantime.

@psychon
Copy link
Member

psychon commented Aug 23, 2015

Was this reported to compton? If yes, where exactly? If no, I will do so.

@timroes
Copy link
Contributor Author

timroes commented Aug 23, 2015

@psychon Haven't reported it. Please feel free to do so (you could anyway explain it better).

@psychon
Copy link
Member

psychon commented Oct 24, 2015

Fix available at chjj/compton#320.

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