Closed manfromth3m0oN closed 4 years ago
Pardon my intrusion.
I don't know, why your example doesn't work. I should work in theory.
What I understand is, you try to catch a close event on your created window. If yes, I've been in your position some years ago. After some struggles I've solved the window close notify problems by setting the WM_PROTOCOLS
property using xproto.ChangePropertyChecked
function and then listening to xproto.ClientMessageEvent
with WM_DELETE_WINDOW
protocol message. Here is the package which implements this approach, may it help you.
Thanks for your reply @jezek,
Either I don't wholly understand your response or you are slightly misconstrued. The code here is intended to serve as a window manager so I don't end up creating any windows. I've taken a look at implementing what you recommend but to no avail. Just to make it doubly clear, I should be setting WM_PROTOCOLS
on every window?
Oh, a window manager. Sorry, my fault, didn't even bother to click on your link. My apologies.
So you are trying to catch the destruction of any window. That wasn't my previous attempt. My attempt was to create window and then be able to listen to the destruction of the window initiated by code, user, etc. I don't really remember clearly, but I think, I made some research back then and that was the only reliable solution back then. I failed to figure out why other solutions didn't work, or I missed something. It feel to me like a hacky workaround back then and it feels the same today.
Just to make it doubly clear, I should be setting WM_PROTOCOLS on every window?
I really don't know right now. When I think, the WM
in WM_PROTOCOLS
stands for window manager. So I've been listening to window manager messages. But you are trying to do the window manager...
I'm sorry I was no real help.
Thanks for the help either way @jezek, I've managed to fix the problem by registering for xproto.EventMaskStructureNotify | xproto.EventMaskEnterWindow
whenever encountering a new window. The problem is fixed so I'm going to close the issue
In a similar fashion to #47 I am trying to receive
DestroyNotifyEvents
. I have registered the root window withEventMaskSubstructureNotify
yet don't receive any. My code to get the root window looks like thisAnd my event loop case concerning
DestroyNotifyEvents
looks like this:I am unsure of what I'm doing wrong or if this is an error with with package (which I do doubt) The whole source can be viewed here Many thanks in advance