Creating a window manager for Linux [closed] Creating a window manager for Linux [closed] linux linux

Creating a window manager for Linux [closed]


Whatever you do, use XCB and not Xlib. It' modern, asynchronous, simpler and gives you direct access to the X11 protocol.


I've written an in-depth tutorial series that shows you how to write an X11 window manager in C++:

In addition, you can check out a simple example window manager, basic_wm, at

It's heavily commented for pedagogical purposes.

On Xlib vs XCB - I would recommend Xlib over XCB if you're first starting out. XCB is more efficient, but it's much more low-level and much more verbose (think assembly language for the GUI). You don't want to burden yourself with premature optimization until you already have a prototype working.


A very minimalistic WM is wm2. I haven't read the source code and hence I don't know if it is a teaching example. Of course you can use libraries that already do much of the abstraction and drawing work for you like gdk and gtk. But since this project is only for personal learning, I'd go the hard way and use Xlib directly.

Here are some links that might be useful for you: