XLib Window Reparenting
I'm trying to make a simple window manager for X to learn about the internal workings of Linux. I've read the whole XLib manual so far, but I'm having a little bit of trouble with window reparenting. Here's the relevant part of my code:
Some of this code may be off a bit, because I'm not near my Linux computer right now. Sorry!
// There is a part here that says to get the next event and store it in "event"
parent = XCreateSimpleWindow(display, RootWindow(display, screen_num), event.xcreatewindow.x, event.xcreatewindow.y, event.xcreatewindow.width + 30, event.xcreatewindow.height + 30, 1, BlackPixel(display, screen_num), WhitePixel(display, screen_num));
XReparentWindow(display, event.xcreatewindow.window, parent, 15, 15);
XMoveWindow(display, parent, 100, 100);
Please tell me what's wrong! Nothing but a simple xterm window appears when I run "startx"! Thanks!
PS: I have changed my .xinitrc script, so it runs an xterm window and my window manager. I am 100% sure my window manager is running!
I have no idea what's wrong with your code, but in my opinion, there's no such thing as a "simple window manager". They are all rather complicated, just that some are rather MUCH complicated and some are rather not so much complicated.
And you won't learn much about Linux internals by looking at Window manager. You may learn something about X-windows, which in most Linux distros is XFree86.