ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The top level window(s) of applications are usually managed by the Window Manager which does the moving/resizing. Child windows are not. To allow for a child window to be moved/resized, your application will need to handle it itself.
Typically the program needs to listen for configure notify events on the main window and then respond to any resizing events reported by moving and resizing its child windows as appropriate for the new size of the top level window.
Most folks can't be bothered to deal with all the detail this requires and use toolkits such as Qt or GTK that do all this sort of boiler-plate stuff for them.
I like writing programs with libX11, but you typically end up with a couple of hundred lines of code before your program even does anything.
oh that makes sense...thanks! I was wondering how Qt layouts work....
I know xlib can be messy, but I really want to start making my own window managers. Do you know any good tutorials on writing window managers?
If you don't mind C++ this one seems reasonable, though it looks like the author never completed the full series of articles. Still, what's there is useful.
Personally, I'd rather see it done in pure C as I'm not really a fan of the whole OO thing.
The guy does have the full code on github though. I will probably finish whatever he doesn't cover by reading the source code...
Yeah I also prefer raw C... despite all the fancy features C++ provides.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.