Commit graph

205 commits

Author SHA1 Message Date
Zhongheng Liu
417f85ebd7 add fork note 2026-04-28 17:54:43 +02:00
Zhongheng Liu
f4f056f991 Custom command parsing from config file and handling 2026-04-28 17:38:57 +02:00
Ben Buhse
f16f07fa26
Fix zombie processes from keybind spawns
Previously, beansprout used std.process.Child.spawn without ever calling
wait(), leaving exited children as zombies. This commit switches to a
double-fork based off river-classic's spawn handling, where the actual
spawned process gets orphaned and reparented to PID 1. This way, the
parent (i.e. beansprout) only has to wait for the intermediate child.

Also switch tokenizeShell and expandTilde to produce [:0]const u8 tokens
so the argv array for execvpeZ can be built without copying each string.

Fixes: #12
2026-04-26 11:22:35 -05:00
Ben Buhse
4cf0899457
(Re[re])bump version to 0.3.0-dev 2026-04-12 11:31:07 -05:00
Ben Buhse
87bbe3883e
Tag v0.2.3 2026-04-12 11:30:34 -05:00
Ben Buhse
e862aca887
Fix crash when killing WM with windows active
In commit 75308a04, I added an assertion to Output.destroy() to verify
that all of its windows had been removed already. The issue is, that
only happened when Output received a .removed event, but that never
came when killing the WM directly. Instead, I simplified the handling
for the .removed event and moved most of that into destroy().

I also changed where structs have their wl_list.link removed (to inside
of their destroys) to make it more consistent. Finally,
XkbBinding.sendWindowToOutput asserts that the current output is actually
focused. Users *should* never have a focused window if there's not also
a focused output.
2026-04-12 11:29:21 -05:00
Ben Buhse
92f79b3b72
Add bug issue template (copied from River) 2026-04-11 10:53:07 -05:00
Ben Buhse
494469af20
(Re)bump version to 0.3.0-dev 2026-04-11 10:08:03 -05:00
Ben Buhse
aae4aad147
Tag v0.2.2 2026-04-11 10:08:03 -05:00
Ben Buhse
75308a0490
Update comments and mildly refactor Output.zig 2026-04-11 10:08:03 -05:00
Ben Buhse
81cc4bd631
Clean comments slightly in Window.zig 2026-04-11 10:08:03 -05:00
Ben Buhse
f97a67c9a8
Add git commmit hash to -dev version numbers 2026-04-10 11:33:14 -05:00
Ben Buhse
4b5405f847
Fix Wallpaper when using multiple outputs
Every wallpaper's node was getting set to position (0,0)... which is
global, not output-local. Adding the node.setPosition() call fixed it.

I also cleaned up some comments and other bits of code in Wallpaper.zig

Fixes: #8
2026-04-05 14:54:03 -05:00
Ben Buhse
91d17042f6
Add two log messages to XkbBindings.focusOutput() 2026-04-02 18:22:10 -05:00
Ben Buhse
8f5d4d3669
Propose 0,0 dimensions for windows floating by rule 2026-04-02 16:01:03 -05:00
Ben Buhse
ed72d8a15d
Fix crash when changing focused output
With output_focus_follows_pointer=true, moving the pointer to a different
output would update Seat's "focused" output, but not the actual focused
window. If you then tried to changed focused outputs with keybinds, the
assertion in XkbBindings.focusOutput() would fail.

This commit also adds support for unfocusing a window on a pointer_leave
event.

Reported-by: Badacko
Fixes: #7
2026-04-01 20:32:34 -05:00
Ben Buhse
6f6d173104
Fix comment in Window.initialize() 2026-03-31 17:13:18 -05:00
Ben Buhse
6136f9d3f8
Don't propose dimensions for windows floating for the first time
Before, we were using the same behavior as when we made any window
floating, which meant we'd set the window to 75% of the output's
dimensions. The issue is that, at least in my case, I usually want a
floating rule for windows that are small and have specific pre-set
sizes, so that didn't make sense. Now, if a window was made floating by
a rule, it should just start with its default dimensions but it can still
be resized later.
2026-03-31 17:06:08 -05:00
Basil Keeler
e785b6e477 Add config option for primary_output_follows_pointer + document it
Closes: #6
2026-03-29 15:11:02 -05:00
Basil Keeler
df0e5ebc36 add suggested break when the correct monitor is found 2026-03-29 15:08:39 -05:00
Basil Keeler
648910c803 change output when pointer moves between them 2026-03-29 15:08:39 -05:00
Basil Keeler
5e2dde7cbd Remove line I added to test 2026-03-29 15:08:39 -05:00
Ben Buhse
2715123248 Merge pull request 'Change window's output when being dragged between them' (#5) from totalchaos/beansprout:main into main
Reviewed-on: https://codeberg.org/beansprout/beansprout/pulls/5
2026-03-29 04:09:27 +02:00
Basil Keeler
ae779e4d14 add suggested break when the correct monitor is found 2026-03-28 21:04:00 -05:00
totalchaos
40cf36890a Remove line I added to test 2026-03-29 03:35:52 +02:00
Basil Keeler
86808dbf47 Change window's output when being dragged between them 2026-03-28 20:03:04 -05:00
Ben Buhse
2e0741acde
Unfocus window when moving it to a not-selected tag
This fixes an issue where focus wasn't automatically moved off of
windows if they were moved to non-visible tags. This wasn't always an
issue, as some cases would update the focus anyways, but now it should
always work.
2026-03-27 12:36:43 -05:00
Ben Buhse
3af39def4a
Fix WM after switching TTYs and back
When all outputs are removed, an "orphan" list is created for any
remaining windows. I was accidentally just immediately re-assigning the
orphan windows back to the final output being removed, because I was
checking the seat's focused output to early. This correctly checks if
the seat is changing focus *before* checking the seat's current focus.

Fixes: #3
2026-03-27 12:36:42 -05:00
Ben Buhse
440d58c8d8
Convert single-window.png to jpeg
This saved about 1.4MB which should help it load a bit faster on the web UI. For whatever reason, the tiled-windows.jpeg was actually bigger than as a png, so I left it.
2026-03-27 10:16:41 -05:00
Ben Buhse
83fb50685a
Update TODO 2026-03-27 09:55:57 -05:00
Ben Buhse
6a675217e1
Bump version to 0.3.0-dev 2026-03-22 12:34:15 -05:00
Ben Buhse
532b527646 Tag v0.2.0 2026-03-22 12:24:51 -05:00
Ben Buhse
fc60e3ac35
Clean up a couple of calls in main
Also add sighandler for SIGTERM
2026-03-22 12:07:44 -05:00
Ben Buhse
bbca05fed6
readme: mention that beansprout is in GURU now 2026-03-22 10:13:19 -05:00
Ben Buhse
581f4334be
Fix toggle_passthrough command
When I implemented it, I forgot to verify I actually added a way to shut
it off...
2026-03-21 20:24:45 -05:00
Ben Buhse
96d34bc043
Unmark some structs as pub 2026-03-20 15:43:53 -05:00
Ben Buhse
2f29434af0
Add single_window_ratio to Bar when != 1
This adds single window ratio's percent after the primary ratio into the
bar, but only when the ratio isn't 1 (so, on small screens where people
are using 100% of the output for windows, it won't be there).
2026-03-20 08:13:54 -05:00
Ben Buhse
63f5fc1bcd
Implement variable single-window ratio 2026-03-19 15:15:28 -05:00
Ben Buhse
52785078b7
Handle finished events in WM and IM
I was silently ignoring these before, which wasn't bad, but mostly meant
we wouldn't close them if the compositor ever finished. For WM, we just
send SIGINT and exit the WM in main(). For IM, we destroy() and clean up
like we do in XkbConfig.
2026-03-18 08:51:00 -05:00
Ben Buhse
a1bd356943
Implement river-xkb-config-v1
This commit adds support for the river-xkb-config-v1 protocol. There's
a new keyboard_layout block in config that can take options from
xkeyboard-config(7).
2026-03-16 14:19:59 -05:00
Ben Buhse
799963ae42
Update river wayland protocols 2026-03-15 17:32:53 -05:00
Ben Buhse
ea8a5948a4
Bump version to 0.2.0-dev 2026-03-06 13:59:30 -06:00
Ben Buhse
ca3e77cca9
Release v0.1.0 2026-03-06 13:48:49 -06:00
Ben Buhse
411f679491
Fix bug where Buffers were never freed
The issue was that, when reiniting Buffers, the intrusive linkedlist
node was clobbered and we lost reference to it. That meant most of the
Buffers would be memory leaks. Now, we save the node during
reinitializion.
2026-03-06 11:37:21 -06:00
Ben Buhse
678d0563ed
Add exit_river keybinding
Recently, river removed the hardcoded Ctrl+Alt Delete keybinding that
exits river and replaces it with a new `exit_session` request. This adds
support for that request via the new `exit_session` bind. We also added
3 hardcoded default keybinds to: exit river, reload the config, and
open foot. This way, if the config fails to load or is missing, you
should still be able to try reload. I guess you're still SOL if you have
at least one keybind and it's not reload_config, but you do what you can
do.
2026-03-06 09:21:07 -06:00
Ben Buhse
38400c66d6
Merge branch 'new-tag-overlay' 2026-03-05 20:40:14 -06:00
Ben Buhse
6e85e0cffe
Remove zwlr_layer_shell_v1 bind
We don't need it anymore because everything using it has been switched
to river_shell_surfaces
2026-03-05 20:37:21 -06:00
Ben Buhse
3150d1a842
Switch TagOverlay to use river_shell_surface_v1
This follows the same patterns that Wallpaper and Bar did and makes
TagOverlay use the same manage/render cycle as the rest of the WM.

We also switched to just use a poll timer like river-tag-overlay instead
of using the timerfd. I realized that the Zig stdlib doesn't actually
support timerfds for FreeBSD right now and I don't feel like adding them.
2026-03-05 20:36:19 -06:00
bwbuhse
24374f3f62 Fix link to my ebuild repo 2026-03-04 16:25:44 +01:00
Ben Buhse
8b8efe2186
Switch Wallpaper to use river_shell_surface_v1
This changes it from using zwlr_layer_surface's to river shell surfaces
just so that the manage/render cycle matches as much of the rest of the
wm as possible.

I also made a few small fixes to Bar that I noticed while working on
the wallpaper change
2026-03-03 20:53:28 -06:00