问题描述
我的新主项目之一将是一个简单的Window Manager,但是在开始之前,我需要了解一些知识:
One of my new home projects will be a simple Window Manager, but before start I need to know some things:
- 哪种语言是最好的?
- 从哪里获得一些学习资源?
推荐答案
一个重要的决定是如何与X服务器通信.您可以为您选择的语言使用 Xlib 绑定,也可以使用更高级别的绑定 XCB 绑定. (如果您疯狂,则可以直接打开X服务器的套接字)
One important decision is how you're going to talk to the X server. You can use the Xlib bindings for your language of choice, or you can use the higher-level XCB bindings. (If you're insane, you might open a socket to the X server directly.)
要了解窗口管理器的行为方式,有两个文档指定了约定和策略: EWMH 和 ICCCM .符合这些要求意味着您的窗口管理器将在GNOME,KDE,XFCE和随之而来的任何其他桌面环境中表现良好,尽管在您初次尝试时只需忽略它们当然会更容易.
To know how a window manager ought to behave, there are two documents that specify the conventions and policies: EWMH and ICCCM. Conforming to these means your window manager will behave nicely in GNOME, KDE, XFCE, and any other desktop environment that comes along, although simply ignoring them is certainly easier on your first try.
窗口管理器不必是庞大而复杂的C球-成功的窗口管理器已经用Lisp,Haskell和Python等高级语言编写,甚至C语言中的一些语言仍然很小并且易于阅读.用Haskell编写的 XMonad 停留在1000行以下已经有一段时间了. StumpWM (通用Lisp)和 DWM (C)都非常简约.您也许可以阅读他们的源代码,以获取有关如何设计WM的灵感.
A window manager needn't be a huge, complicated ball of C — Successful window managers have been written in high-level languages like Lisp, Haskell, and Python, and even some in C have remained small and readable. XMonad, written in Haskell, stayed under 1000 lines for quite some time. StumpWM (Common Lisp) and DWM (C) are both quite minimalist. You might be able to read their source code to get some inspiration as to how to design a WM.
以利亚·纽伦(Elijah Newren)写道:
Elijah Newren wrote:
请考虑一下, Metacity 的文档可以很好地说说它如何与Windows交互以及它支持哪种扩展属性.
Come to think of it, Metacity's documentation has a good bit to say about how it interacts with windows and what sort of extended properties it supports.
这篇关于建立一个窗口管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!