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

Bad mapping for event 17 : "DestroyNotify" #162

Open
izanagi1995 opened this issue Dec 30, 2017 · 3 comments
Open

Bad mapping for event 17 : "DestroyNotify" #162

izanagi1995 opened this issue Dec 30, 2017 · 3 comments

Comments

@izanagi1995
Copy link

I'm creating a Window Manager with your awesome module.

I had a bug with the "DestroyNotify" event. The event_consumer of the window was never triggered. It's because the real wid is in the field event. I don't know why but the wid in this case is the same as the "MapNotify" event but when I try X.DestroyWindow(ev.wid), it's yield a "BadWindow" error. But when I do X.DestroyWIndow(ev.event), the window is destroyed successfully.

@santigimeno
Copy link
Collaborator

According to the spec:

This event is reported to clients selecting StructureNotify on the window and to clients selecting SubstructureNotify on the parent. It is generated when the window is destroyed. The event is the window on which the event was generated, and the window is the window that is destroyed.

My understanding of this is:

  • event: can be either the destroyed window or its parent depending on whether StructureNotify or SubstructureNotify was used.
  • window: is the actual destroyed window.

IIUC what you're doing, when you call X.DestroyWindow(ev.wid) you're trying to destroy an already destroyed window while when you call X.DestroyWIndow(ev.event) you're trying to destroy its parent and that probably works ok.

@izanagi1995
Copy link
Author

izanagi1995 commented Dec 30, 2017

Ok then... There is still a bug somewhere in the windowmanager example and the core in general. The DestroyNotify event is not passed to the event_consumer. Without the trick X.DestroyWIndow(ev.event), the window is still there without content and to close it, I have to call the destroy with ev.event...

IMO, this should be changed to allow the event_consumer to destroy the window.

EDIT : To give you the full context, I'm launching an app through terminal and then kill it with Ctrl-C and try to get the window closed.

@sidorares
Copy link
Owner

hi @izanagi1995 I'm in 'holiday mode' currently and read notifications diagonally. Can you post code snippet with "what's expected" vs "what's happening"? If you strongly believe your expectations are correct, maybe even create PR which adds your assertion as test case ( obviously currently failing)

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