How to get started writing a compositing WM?

僤鯓⒐⒋嵵緔 提交于 2019-12-03 05:26:01

问题


I would like to write a basic hardware-accelerated window manager, so I've been looking for some documentation on how to get started, but I've only managed to find this tutorial, which uses an outdated version of Clutter and won't build with any version currently available. Are there any other good resources for how to do this, or alternatively, a really bare-bones compositing WM to look at the source of?


回答1:


There are two parts in your question: 1) How to write WM 2) how to write composite manager

Some links to help understand part two (in addition to xcompmgr source):

  • http://www.talisman.org/~erlkonig/misc/x11-composite-tutorial/ (Uses Qt, but very generic and low level)
  • https://github.com/gustavosbarreto/compmgr
  • http://projects.mini-dweeb.org/projects/unagi

Window manager, "part one":

  • I have simple ~100 loc wm in JavaScript: https://github.com/sidorares/node-x11/blob/master/examples/windowmanager/wm.js
  • another minimalist wm (in C), good to start as a reference: https://code.google.com/p/winmalist/
  • most important keyword: SubstructureRedirect event mask. A bit of documentation here



回答2:


The original demo compositing manager was xcompmgr, which I'd recommend for understanding the underlying X extensions.

If you're using OpenGL to do your hardware-accelerated rendering, you'll need to read up on the EXT_texture_from_pixmap extension to avoid copying window contents through userspace. That extension allows you to use hardware-accelerated blits for those copies instead.

You'll probably also be interested in the specification for _NET_WM_SYNC_REQUEST, to allow tear-free rendering synchronized to vertical retrace.



来源:https://stackoverflow.com/questions/13260667/how-to-get-started-writing-a-compositing-wm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!