commit e9b65c6
Michael Forney
·
2013-12-07 06:06:53 +0000 UTC
parent 3461ee5
Add README
1 files changed,
+91,
-0
+91,
-0
1@@ -0,0 +1,91 @@
2+swc
3+===
4+swc is a small Wayland compositor implemented as a library.
5+
6+It has been designed primary with tiling window managers in mind. Additionally,
7+notable features include:
8+
9+* Easy to follow code base
10+* XWayland support
11+* Can place borders around windows
12+
13+Dependencies
14+------------
15+* wayland
16+* libdrm
17+* libevdev
18+* libxkbcommon
19+* pixman
20+* [wld](http://github.com/michaelforney/wld)
21+* libudev
22+* linux[>=3.12] (for EVIOCREVOKE)
23+
24+libudev is currently required for input hotplugging support. I'd like to get rid
25+of this dependency, but it seems that libudev is currently the only way to get
26+this functionality.
27+
28+For XWayland support, the following are also required:
29+* libxcb
30+* xcb-util-wm
31+
32+Implementing a window manager using swc
33+---------------------------------------
34+You must implement two callback functions, `new_window` and `new_screen`, which
35+get called when a new window or screen is created. In `new_window`, you should
36+allocate your own window window structure, and register a listener for the
37+window's event signal. More information can be found in `swc.h`.
38+
39+ void new_window(struct swc_window * window)
40+ {
41+ /* TODO: Implement */
42+ }
43+
44+ void new_screen(struct swc_screen * screen)
45+ {
46+ /* TODO: Implement */
47+ }
48+
49+Create a `struct swc_manager` containing pointers to these functions.
50+
51+ const struct swc_manager manager = { &new_window, &new_screen };
52+
53+In your startup code, you must create a Wayland display.
54+
55+ display = wl_display_create();
56+
57+Then call `swc_initialize`.
58+
59+ swc_initialize(display, NULL, manager);
60+
61+Finally, run the main event loop.
62+
63+ wl_display_run(display);
64+
65+Why not write a Weston shell plugin?
66+------------------------------------
67+In my opinion the goals of Weston and swc are rather orthogonal. Weston seeks to
68+demonstrate many of the features possible with the Wayland protocol, with
69+various types of backends and shells supported, while swc aims to provide only
70+what's necessary to get windows displayed on the screen.
71+
72+I've seen several people look at Wayland, and ask "How can I implement a tiling
73+window manager using the Wayland protocol?", only to be turned off by the
74+response "Write a weston shell plugin". Hopefully it is less intimidating to
75+implement a window manager using swc.
76+
77+TODO
78+----
79+* VT switching
80+* XWayland copy-paste integration
81+* Better multi-screen support, including mirroring and screen arrangement
82+* Mouse button bindings
83+* Resizing/moving windows by dragging
84+* Touchpad support
85+
86+Future Plans
87+------------
88+* I'd like to revisit `wld` and set it up in such a way that an EGL backend can
89+ be implemented so more hardware is supported.
90+* I also want to revisit the planes implementation, allowing full screen
91+ surfaces to be scanned out directly, or to a hardware plane.
92+