aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-09-05 12:29:35 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2016-09-05 12:29:35 -0400
commit67714de1fe69da81140869b58f978cd67ce5a07d (patch)
tree5663e2e48b49f59d48d7a566b345996a3784f9ca
parentFix typo (diff)
downloadsway-67714de1fe69da81140869b58f978cd67ce5a07d.tar.gz
sway-67714de1fe69da81140869b58f978cd67ce5a07d.tar.zst
sway-67714de1fe69da81140869b58f978cd67ce5a07d.zip
Remove HACKING.md
-rw-r--r--HACKING.md81
1 files changed, 0 insertions, 81 deletions
diff --git a/HACKING.md b/HACKING.md
deleted file mode 100644
index 25d737a3..00000000
--- a/HACKING.md
+++ /dev/null
@@ -1,81 +0,0 @@
1## Code overview
2
3The following is a brief code overview / general introduction for those wanting
4to hack on sway.
5
6### wlc
7
8In Wayland the compositor is the display server. That's a design decision that
9brings several advantages, but the downside is that all compositors need to
10implement an entire display server as well.
11
12To aid the situation there are several *wayland display servers* being
13implemented as libraries so that compositors can stick to doing compositing and
14leave the low level details to one of those libraries. In sway that library is
15`wlc`, and it handles tty switching, logind sessions, input, everything that
16deals with the GPU, and just about everything concerning the Wayland protocol
17itself (as of writing there's not a single call to any wayland functions inside
18of sway). sway communicates with wlc via a callback api found in
19`sway/handlers` (`wlc_interface`). The code in that file deals with all the
20entry points from wlc to sway.
21
22### Commands
23
24Being a tiling window manager, controlling it via commands is an important part
25of its functionality, and `sway/commands` which deals with that is by far the
26biggest file in the codebase.
27
28There are multiple ways to trigger a command: via the keyboard, via the config
29file, or via the IPC interface.
30
31### IPC
32
33i3 has an IPC interface (it creates a socket that applications can connect to
34and issue commands or queries via its protocol), and sway replicates that
35protocol (so e.g. `i3-msg` can be used with sway by simply changing the socket,
36e.g. `i3-msg -s $(sway --get-socketpath)`). The code for that lies in
37`sway/ipc`.
38
39### Config
40
41The config state and loading the config file lies in `sway/config`. Since the
42config file is simply a list of commands, that code mostly just parses the text
43and then hands commands off to `commands` for execution.
44
45### Pointer handling
46
47The mouse has buttons, state (due to buttons pressed, e.g. "dragging",
48"resizing" etc.) and movement. Most code related to that lies in
49`sway/input_state`.
50
51### Containers
52
53In traditional *floating* window managers, all windows (or *views* as they're
54called in sway) are placed anywhere on the screen. In a tiling window manager
55like sway the views are *arranged* by the compositor, and the user mostly just
56manipulates the arrangement via commands (floating views are also supported).
57
58In sway, each *output* (a physical monitor) has one or more *workspaces* which
59has one or more *views* (the actual windows). In order to keep track of the
60arrangement of the views, sway organizes everything in a tree of *containers*.
61Each of the previously mentioned things is a type of container. In addition
62there's a type of container called *container* which is needed to arrange other
63containers as siblings (horizontal or vertical layout), and a *root container*
64which exists for practical reasons.
65
66`sway/containers` contains the code for this and understanding containers is
67essential in understanding sway.
68
69Also, the code that actually arranges the different views lays in
70`sway/layout`.
71
72### Focus
73
74When changing workspace, changing output, changing view or just moving the
75pointer you change which view has *focus*. The code for handling this and
76e.g. deciding what view receives input events is handled in `sway/focus`.
77
78### Notes
79
80As sway is a work in progress, as of writing it is still not versioned. Use the
81`master` branch of sway and wlc for now.