r/linux_programming • u/cryptic_gentleman • Jul 10 '24
Xlib XDestroyWindow causes crash
I have a simple Xlib window manager written in C++ and so far everything is working fine except for handling when windows are destroyed. In the event that an application window is destroyed I attempt to search for its parent window to also destroy. However, upon any window being destroyed the display disconnects from the X server and I get an error saying:
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 2 (X_ChangeWindowAttributes)
Resource id in failed request: 0x80000c
Serial number of failed request: 8336
Current serial number in output stream: 8359The only time I change window attributes is when I create the frame window and set the override_redirect attribute to true which works when running the window manager.
The code can be found on GitHub
View all comments
Show parent comment
1
u/avitld Jul 27 '24
Hey, I'm not OP but I stumbled upon this post and your comments have really helped me with my own WM issues. I'm just asking here because finding help for XLib is hard. I Implemented clicks like in your comment so that they will activate the window. But now this has broken my move/resize system which worked by mod + clicking the frame. Instead it treats the frame how it treats the client. I don't know if I've done something wrong (most likely) but I am not sure of what could be causing this.