Creating a window manager for Linux

后端 未结 8 749
囚心锁ツ
囚心锁ツ 2020-12-23 10:45

I want to create a simple stacking window manager (in C) for private use, mainly for the purpose of learning and challenging myself.

I\'ve looked throug

相关标签:
8条回答
  • 2020-12-23 10:46

    metacity uses gtk for certain UI elements. See its HACKING and README.

    see also Where are some good Xlib programming guides?

    0 讨论(0)
  • 2020-12-23 10:57

    Xmonad might be a good place to start.

    0 讨论(0)
  • 2020-12-23 10:58

    http://code.google.com/p/partiwm/ is an attempt to write a window manager (tiling, not stacking) from scratch, it might be useful to you to read through the code.

    0 讨论(0)
  • 2020-12-23 11:02

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

    • http://seasonofcode.com/posts/how-x-window-managers-work-and-how-to-write-one-part-i.html

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

    • https://github.com/jichu4n/basic_wm

    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.

    0 讨论(0)
  • 2020-12-23 11:04

    Have a look at the code for dwm. The codebase is beautiful and easy to understand. The entire thing is about 2000 lines.

    0 讨论(0)
  • 2020-12-23 11:06

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

    0 讨论(0)
提交回复
热议问题