Commit graph

17 commits

Author SHA1 Message Date
Ben Buhse
8b5681a26f
Fix a de-init that I missed in 9fef3f70 2026-02-23 18:57:41 -06:00
Ben Buhse
1b37ab7afd
Implement passthrough mode
When active, key presses are passed directly to the focused window.
I've mostly used this for testing beansprout, but I'm sure there are
other uses.
2026-02-22 08:59:45 -06:00
Ben Buhse
7045b21534
Handle {exit_}fullscreen_requested events on Windows 2026-02-19 13:56:37 -06:00
Ben Buhse
de55f0c6ee
Move orphan window handling into wm.manage()
This just helps consolidate it into a single place
2026-02-18 17:12:51 -06:00
Ben Buhse
5ca0b9d157
Add documentation and example for window rules 2026-02-18 16:13:16 -06:00
Ben Buhse
76f292332b
Fix floating window initial sizes
When I added support for propose dimensions, I was foolishly just
choosing the min (or max) if only one was set. However, a lot of windows
will a set a very small min size with no max, which meant we would have
really tiny windows when first floating one. The fix was to try set to
75% but then clamp to the min/max dimensions the window gave.

After fixing that, there was still an issue where windows kept their
size after being floated. That's because there was a propose_dimensions
call happening later in Window.manage(). I'm skipping that now if a
window became floating in the same manage event.
2026-02-18 16:06:09 -06:00
Ben Buhse
c4da4ef30a
Make window rules frame perfect
This moves window initialization earlier in the manage sequence.
Previously, it was on the Window's first manage() call, but this is
after the layout has already been calculated, which matters both because
of tags and whether the window starts floating or not.

Now, initialization is handled in a separate function that gets called
in Output.calculatePrimaryStackLayout() instead.
2026-02-17 16:54:14 -06:00
Ben Buhse
5333b4cbe0
Create utils.Rect struct for geometries
Also fixed a crash that I'm really not sure how I didn't have happen
before during Output.create()

Right now, only Window is updated to use Rect. I'll try updating all
instances of x,y,width,height combo to use it.
2026-02-16 17:16:25 -06:00
Ben Buhse
5922107579
Implement configuration for the Bar
This adds a few new options for the bar (instead of hardcoding all of
them). fonts, text_color, background_color, positoon, and margins.

Also fixed a couple of bugs when reloading the config and destroying
layer shell and wl surfaces in the wrong order.
2026-02-16 16:07:02 -06:00
Ben Buhse
dbf32e793c
Finish wiring up the TagOverlay
We had to fix a couple of compile errors that weren't showing while it
wasn't wired up (since I never just tried to compile TagOverlay.zig on
its own). We also changed the lifecycle to re-create/destroy the surface
to show/hide it, similar to the way that river-tag-overlay actually did
it.

Finally, I added @branchHint(.cold) to a few places in the event loop
where, if we're in the branch, the wm is definitely exiting, so it's
fine if they're cold (should almost never happen).
2026-02-16 11:33:48 -06:00
Ben Buhse
2bef233d8f
Wire up TagOverlay into Config
The tag overlay still isn't actually created anywhere, but now it can
be configured.
2026-02-16 11:33:43 -06:00
Ben Buhse
83946ce97a
Fix wallpaper and bar rendering when scale >1
We track the scale for wallpaper and render now and have to re-render
when the  scale changes. For the bar, this includes recreated the
fcft fonts.
2026-02-15 16:59:18 -06:00
Ben Buhse
5c427234d7
Add layer shell support and fix floating windows
Now, I actually save the river-layer-shell-v1 and keep track of the
non-exclusive area. The layout calculation uses the usable area instead
of the entire output's geometry.

I removed boundary clamping for the floating windows because it was a
bit janky when hitting the edges. I'll probably add it back at some
point. I also made windows default to 75% of the usable area instead of
keeping their tiled size so that maximized windows look decent when
floating for the first time. Finally, since I removed the clamping, I
added a center_float keybind to center a floating window. If you're
cycling through focused windows and one isn't on the screen, you can use
the center_float bind to get the window visible again.

Replaced all divTrunc with divFloor to be consistent. I think they
should all be positive, anyways, so they'd be the same, but I like just
having one.
2026-02-14 11:30:37 -06:00
Ben Buhse
2b336299eb
Add x/y paramaters to renderChars and renderGlyphs 2026-02-13 19:17:34 -06:00
Ben Buhse
1df6820b1d
Implement per-tag primary_count and primary_ratio
By default, each tag mask will use the default count and ratio. If the
mask gets modified by any of the commands, it gets added to a hash map.
When changing tag masks, the current count and ratio are stored, and
they're used again later if you switch back to that mask.

This commit also adds primary_count and primary_ratio to the general
settings for the config, so users can set a default count/ratio to use.
2026-02-12 14:10:21 -06:00
Ben Buhse
8e93395360
Update README.md, add docs/CONFIGURATION.md
I've finally added a somewhat usable README and also explained
configuration in docs/CONFIGURATION.md
2026-02-11 20:22:41 -06:00
Ben Buhse
3ceaf8a004
Move TODOs into separate file, update README
I still have lots to do for the README, but I'll do that once I actually
am able to daily-drive beansprout.
2026-02-11 15:15:48 -06:00