The spawn keybind takes a command to launch with `std.process.Child.init`
but we weren't handling quotes in the arguments. We had to add special
tokenization to respect quotes.
I used to manually convert pixels from RGBA=>ARGB because Wayland
compositors are only guaranteed to support XRGB and ARGB, but zigimg
doesn't include either of those. This was a bit slow, especially on
debug builds (though not *super* noticeable on release builds).
I realized, though, that zigimg's Rgba32 format is the same as pixman's
a8b8g8r8... on little-endian. I kept the old code just in case someone
out there happens to be running beansprout on MIPS, but I have not
tested it.
Before, they would try send the window to the "next" output even if
there was only one output... which really just means sending the window
to the bottom of the stack. Instead, they should be a noop.
Also fixed a bug when removing all outputs where the seat wouldn't
clear its focused output.
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.
This is currently only used when floating a window for the first time.
If the window has preferred dimensions, we will use those isntead of the
75% of the screen size rule we were using before.
One was where WM was assuming that a seat existed during first manage,
but that's not always true, so we have to check that before running the
initialization code. I also split that off into its own function like in
Window.
The other crash was when trying to calculate the layout with the
output's width and/or height equal to zero, it would crash subtracting
the border width.
I discovered both of these when try to restart beansprout without
restarting River.
I found this when trying to restart beansprout after a separate crash.
Basically, the .window handler used to put new
windows on seat.focused_output for new windows,
but after a restart this is still null even when
an output (and windows) already exist.
Windows became orphans with output=null, breaking
the focused_window.output == focused_output assert
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.
At least tag rules seem to be working (but they're not frame perfect).
I might need to investigate more for float/no_float.
Rules are ANDed and only apply during window's first manage sequence,
so changing an appid/title doesn't affect anything.
There were two bugs:
1) If we were focused on the first window and then tried to use the
zoom keybind, we looked for the next tiled window in the list
(correctly skipping floating windows), but we didn't also check the
tags. This meant that if the next window was on a non-visible tag,
it didn't work.
2) After fixing that, we weren't updating the focus to the newly
promoted window, so the border would flash around the window that got
moved to 2nd for a frame. We just needed to update the pending focus
window for seat if we had to swap windows.
This helps us with de-duplication. Previously, if you had host-specific
keybinds on the same key combination, the compositor would choose the
first... which is the opposite of how everything else in our config
handling works.
Before, we were missing the initial events from the wl_output, including
the scale. This meant that we weren't scaling the bar clock correctly.
To fix it, we just moved the wl_global binding into the .wl_output event
We also got rid of the hashmap of outputs in Globals and Context.
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.
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.
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).
Both the wl_surface and layer_surface in each are always expected to
exist at the same time. Since they're optional, it makes more sense to
combine them into a single optional struct.
Since each bar has its own, it's easier to just share it. This does
create a consistent slight overhead, but may be useful anyways if we
care about the Env more further down the line.