Writing a window manager for X (.org)

各种窗口管理器和美化相关
回复
头像
youqika
帖子: 720
注册时间: 2008-09-25 20:56

Writing a window manager for X (.org)

#1

帖子 youqika » 2011-11-27 19:46

> Hi, newsgroup!
>
> The problem: I want to write a window manager - just for
> "exercise" - and I cannot find a documentation on the
> net somehow describing, where i should start.

The O'Reilly "Xlib Programming Manual" is a very good book (but get it's
companion the "Xlib Reverence), and covers all topics (with source code)
up to and including a simple example window manager.

The one "problem" with the book is that examples tend to be complete and
correct, but rather verbose. The "hello, world" program is 7 pages long
(you can do it in nearly 7 lines, at a push), but is very complete and is
really more than a "hello, world" program.


> It's not hard to get some sources (1000s of windowmanagers
> on Linux) of course, I just don't have a single clue, where
> to ->start.

They may be worth looking at later, but only once you know what's going on.

If you want to get in to "complete" window manager design, eg one that
obeys requests from various windows, you might like to have a glance at
teh ICCCM. Be warned, though, this document assumes pretty in-depth
knowledge.


> 2 questions for example:

> - How do I "register" my app as windowmanager at X ?

You select SubstructureRedirectMask on the root window. This allows the
window manager to intercept requests to move/resize windows etc.

> - What interfaces/callbacks do I have to provide ?
> - How do X-Server and WM communicate ?

Via the X protocol...? More specifically, mostly they don't, the
windowmanager intercepts communication. Communication is done via hints
and properties.

> You already see it: My knowledge about X still is ...
> quite "basic". (Please laugh _now_, I like it the tough way ! ;-)


> To be finally more explicit: I _really_ don't need answers
> to my questions, they're just examples. I'm just asking,
> if someone knows, where to start reading.

How much have you written in Xlib?

-Ed



--
(You can't go wrong with psycho-rats.) (er258)(@)(eng.cam)(.ac.uk)

/d{def}def/f{/Times findfont s scalefont setfont}d/s{10}d/r{roll}d f 5/m
{moveto}d -1 r 230 350 m 0 1 179{1 index show 88 rotate 4 mul 0 rmoveto}
for /s 15 d f pop 240 420 m 0 1 3 { 4 2 1 r sub -1 r show } for showpage

代码: 全选

A web site has pointers to the documentation of ICCCM which defineds
the responsibilities and requirements for X Window System window managers.
http://www.rahul.net/kenton/index.shtml
UCHIHA
运气是为白痴准备的
头像
YeLee
论坛版主
帖子: 26406
注册时间: 2008-08-13 8:48
系统: Fundu i64
来自: 东海硇州,一双管钥。
联系:

Re: Writing a window manager for X (.org)

#2

帖子 YeLee » 2011-11-28 12:12

:em20 :em20 :em20 居然是英文的,这个东西倒很像20年前linus那信
◎当我站在道德的高度上俯视别人的时候,发现自己是多么渺小。
♥执着但不偏激,反对而不排斥,坚决捍卫矛盾体的存在方式。
★★★天气预报★★★
fcitx-yatable一个可以使用的码表输入法
[教程]几个实例攻克软件编译难关
Gentoo Development Guide
字体相关
头像
youqika
帖子: 720
注册时间: 2008-09-25 20:56

Re: Writing a window manager for X (.org)

#3

帖子 youqika » 2011-11-28 12:15

有兴趣有时间的童鞋可以自己写个WM试试啊,应该也蛮好的
UCHIHA
运气是为白痴准备的
回复