summaryrefslogtreecommitdiffhomepage
path: root/.rules/plan/phase-06-effects.md
blob: 6a21f72c51861ac22137ad07ca8e61f53c964373 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Phase 6 — Visual Effects (Compositor Features)

---

## Step 6.1 — Window decorations (title bars)

For each managed window, draw a simple title bar above it:
- A colored rectangle.
- The window title (from `WM_NAME` or `_NET_WM_NAME` property).
- A close button (clickable, sends `WM_DELETE_WINDOW`).

Use raylib's `DrawRectangle()` and `DrawText()`.

**Verify:** Each window has a title bar showing its name. Clicking the
close button closes the window.

---

## Step 6.2 — Drop shadows

Draw a soft shadow behind each window. Approach:
- Precompute a shadow texture (gaussian blur of a solid rect) at startup.
- Draw it as a 9-slice scaled quad behind each window, offset down and
  right by a few pixels.

Or use raylib's shader system with a blur shader on an expanded quad.

**Verify:** Each window has a soft drop shadow. Overlapping windows show
correct shadow layering.

---

## Step 6.3 — Window transparency / opacity

Read `_NET_WM_WINDOW_OPACITY` from each window's properties. Apply it
when drawing the texture (raylib's `DrawTexturePro` with tint alpha, or
a custom shader uniform).

**Verify:** Run:
```bash
DISPLAY=:1 xprop -f _NET_WM_WINDOW_OPACITY 32c \
    -set _NET_WM_WINDOW_OPACITY 0x7FFFFFFF -id <wid>
```
to set 50% opacity on a window. It becomes translucent in the compositor.