Skip to content

Commit 2283dc9

Browse files
authored
bugfix: remove dead code related to parallax modes, remove dead docs,… (#77)
* bugfix: remove dead code related to parallax modes, remove dead docs, add dedicated input guide * if no inputs are set, enable workspace by default --------- Co-authored-by: sandwich <[email protected]>
1 parent 6896424 commit 2283dc9

22 files changed

Lines changed: 256 additions & 115 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ PROTOCOL_HDRS =
100100
endif
101101

102102
# Core module sources (always included)
103-
CORE_SRCS = src/core/easing.c src/core/animation.c src/core/layer.c src/core/config.c src/core/monitor.c src/core/log.c src/core/parallax.c src/core/cursor.c src/core/render_core.c src/core/event_loop.c \
103+
CORE_SRCS = src/core/easing.c src/core/animation.c src/core/layer.c src/core/config.c src/core/monitor.c src/core/log.c src/core/cursor.c src/core/render_core.c src/core/event_loop.c \
104104
src/core/input/input_manager.c src/core/input/providers.c src/core/input/modes/workspace.c src/core/input/modes/cursor.c src/core/input/modes/window.c
105105

106106
# Renderer module sources (conditional)

docs/configuration/environment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The following variables are recognized by hyprlax today (non-exhaustive; impleme
5858
- `HYPRLAX_RENDER_MARGIN_PX_X=24` Extra horizontal safe margin (px)
5959
- `HYPRLAX_RENDER_MARGIN_PX_Y=24` Extra vertical safe margin (px)
6060
- `HYPRLAX_RENDER_OVERFLOW=repeat_x` Overflow behavior (repeat_edge|repeat|repeat_x|repeat_y|none)
61-
- `HYPRLAX_PARALLAX_MODE=cursor` Parallax mode (workspace|cursor|hybrid)
61+
- `HYPRLAX_PARALLAX_INPUT=workspace,cursor:0.3` Parallax inputs (comma list; optional weights)
6262
- `HYPRLAX_PARALLAX_SOURCES_CURSOR_WEIGHT=0.5` Cursor source weight (0..1)
6363
- `HYPRLAX_PARALLAX_SOURCES_WORKSPACE_WEIGHT=0.5` Workspace source weight (0..1)
6464

docs/configuration/examples/cursor-parallax.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ vsync = false
99
easing = expo
1010

1111
[global.parallax]
12-
mode = "cursor" # Mouse-driven parallax for focus-follow effect
12+
input = "cursor" # Mouse-driven parallax for focus-follow effect
1313

14-
[global.parallax.sources]
15-
workspace.weight = 1.0 # disable workspace-driven movement
16-
cursor.weight = 1.0
14+
# No workspace influence when using cursor-only input
1715

1816
# Invert X so layers shift opposite cursor (stronger depth feeling)
1917
[global.parallax.invert.cursor]

docs/configuration/examples/multi-layer.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ easing = "expo"
1111

1212
# Optional: Add subtle cursor influence
1313
[global.parallax]
14-
mode = "hybrid"
15-
16-
[global.parallax.sources]
17-
workspace.weight = 0.8 # Primarily workspace-driven
18-
cursor.weight = 0.2 # Subtle cursor influence
14+
input = "workspace,cursor:0.2" # Primarily workspace-driven
1915

2016
[global.input.cursor]
2117
sensitivity_x = 0.5
@@ -73,4 +69,4 @@ align = { x = 0.5, y = 1.0 } # Bottom-aligned
7369
# shift_multiplier = { x = 1.0, y = 0.5 } # Different X/Y speeds
7470
# opacity = 0.3
7571
# blur = 0.0
76-
# fit = "cover"
72+
# fit = "cover"

docs/configuration/migration-guide.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ TOML allows cursor-driven parallax:
6565

6666
```toml
6767
[global.parallax]
68-
mode = "cursor" # New feature!
68+
input = "cursor" # New feature!
6969

7070
[global.input.cursor]
7171
sensitivity_x = 1.0
@@ -133,7 +133,7 @@ margin_px = { x = 50, y = 50 }
133133

134134
# Cursor parallax
135135
[global.parallax]
136-
mode = "cursor"
136+
input = "cursor"
137137

138138
[global.input.cursor]
139139
sensitivity_x = 1.2
@@ -203,11 +203,7 @@ debug = false
203203

204204
# Optional: Add cursor parallax
205205
[global.parallax]
206-
mode = "hybrid" # Both workspace and cursor
207-
208-
[global.parallax.sources]
209-
workspace.weight = 0.7
210-
cursor.weight = 0.3
206+
input = ["workspace", "cursor:0.3"] # Both workspace and cursor
211207

212208
[global.input.cursor]
213209
sensitivity_x = 0.8

docs/configuration/toml-reference.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ Complete reference for hyprlax TOML configuration format.
4646

4747
| Key | Type | Default | Description |
4848
|-----|------|---------|-------------|
49-
| `mode` | string | "workspace" | Parallax mode: "workspace", "cursor", "hybrid" |
49+
| `input` | string/array | "workspace" | Active sources (e.g., "workspace,cursor:0.3" or ["workspace", "cursor:0.3"]) |
5050

5151
### [global.parallax.sources]
5252

53-
Control input source influence in hybrid mode:
53+
Control input source influence via weights:
5454

5555
| Key | Type | Range | Description |
5656
|-----|------|-------|-------------|
@@ -152,16 +152,12 @@ shift_multiplier = { x = 1.0, y = 0.5 }
152152
[global]
153153
fps = 144
154154
debug = false
155-
duration = 0.0 # Not used in cursor mode
155+
duration = 0.0
156156
vsync = true
157157
easing = "expo"
158158

159159
[global.parallax]
160-
mode = "cursor" # Enable cursor tracking
161-
162-
[global.parallax.sources]
163-
workspace.weight = 0.0
164-
cursor.weight = 1.0
160+
input = "cursor" # Enable cursor-only tracking
165161

166162
[global.parallax.invert.cursor]
167163
x = true # Layers move opposite to cursor

docs/guides/animation.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Master the animation system to create smooth, natural parallax effects.
44

5-
## Parallax Modes
5+
## Parallax Inputs
66

77
Hyprlax combines one or more **input sources** to drive layer movement:
88
- `workspace`: driven by workspace changes (original behavior)
@@ -16,9 +16,6 @@ Configure sources via CLI or TOML:
1616
hyprlax --input workspace # workspace only
1717
hyprlax --input workspace,cursor:0.3 # workspace + cursor blend
1818

19-
# Legacy knobs (warn but still supported)
20-
hyprlax --parallax hybrid --mouse-weight 0.3
21-
2219
# TOML (preferred)
2320
[global.parallax]
2421
input = ["workspace", "cursor:0.3"]
@@ -34,7 +31,7 @@ deadzone_px = 3
3431
ema_alpha = 0.25
3532
```
3633

37-
> **Deprecated:** `parallax.mode` + `parallax.sources.(workspace|cursor).weight` remain for compatibility. Prefer `parallax.input` and the `--input` flag for new configurations.
34+
> Use `parallax.input` (or `--input` on CLI) to select sources and optional weights.
3835
3936
### Per-Layer Axis Control
4037

docs/guides/cursor-tracking.md

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Cursor-driven parallax makes layers shift based on mouse position, creating an i
1212

1313
```toml
1414
[global.parallax]
15-
mode = "cursor"
15+
input = "cursor"
1616

1717
[global.input.cursor]
1818
sensitivity_x = 1.0
@@ -27,38 +27,30 @@ path = "foreground.png"
2727
shift_multiplier = 1.0
2828
```
2929

30-
## Parallax Modes
30+
## Parallax Inputs
3131

3232
### Cursor-Only Mode
3333
Layers move only with mouse movement:
3434

3535
```toml
3636
[global.parallax]
37-
mode = "cursor"
38-
39-
[global.parallax.sources]
40-
workspace.weight = 0.0
41-
cursor.weight = 1.0
37+
input = "cursor"
4238
```
4339

44-
### Hybrid Mode
40+
### Blended Inputs
4541
Combine workspace and cursor movement:
4642

4743
```toml
4844
[global.parallax]
49-
mode = "hybrid"
50-
51-
[global.parallax.sources]
52-
workspace.weight = 0.7 # 70% workspace influence
53-
cursor.weight = 0.3 # 30% cursor influence
45+
input = ["workspace", "cursor:0.3"] # 30% cursor influence
5446
```
5547

5648
### Workspace-Only Mode (Traditional)
5749
Disable cursor tracking:
5850

5951
```toml
6052
[global.parallax]
61-
mode = "workspace"
53+
input = "workspace"
6254
```
6355

6456
## Cursor Input Settings
@@ -157,7 +149,7 @@ Objects appear to shift based on depth:
157149

158150
```toml
159151
[global.parallax]
160-
mode = "cursor"
152+
input = "cursor"
161153

162154
[global.input.cursor]
163155
sensitivity_x = 0.8
@@ -269,7 +261,7 @@ sensitivity_y = 1.2
269261

270262
### Cursor Not Tracked
271263
- Check compositor supports cursor position reporting
272-
- Verify `mode` includes cursor: `"cursor"` or `"hybrid"`
264+
- Verify `parallax.input` includes cursor, e.g., `"cursor"` or `"workspace,cursor:0.3"`
273265
- Run with `--debug` to see cursor position
274266

275267
### Jittery Movement
@@ -304,11 +296,7 @@ vsync = true
304296
debug = false
305297

306298
[global.parallax]
307-
mode = "cursor"
308-
309-
[global.parallax.sources]
310-
workspace.weight = 0.0
311-
cursor.weight = 1.0
299+
input = "cursor"
312300

313301
[global.parallax.invert.cursor]
314302
x = false

0 commit comments

Comments
 (0)