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.
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
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.
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).
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.
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).
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.
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.
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.
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
The Wallpaper used to (mostly) live inside of Output. This moves that
into a new Wallpaper.zig file with a similar structure to that of Bar.
The code from WallpaperImage.zig is not in Wallpaper.Image
wl_output.mode provides the physical dimensions of the output, whereas
river_output_v1.dimensions provides the logical dimensions. In general,
we use the logical coordinates from the dimensions event except for a
few places where we do the scale math on the buffers. So, mode was
fairly useless. If I find a need in the future, I can add it back (but
not set the output width/height in it).
This was causing us to exist when we probably shouldn't have been.
I think the main issue was all the syncNextCommit calls for the bar.
These changes have seeminglly fixed my crash
Before, if you restarted the WM with windows already present, any
non-focused window would just not have a border (because borderes are
only drawn on focus change, which happens for all new windows, but not
exisiting ones). I guess this probably would've happened if users add
new windows appending and didn't focus on new window spawns? Anyways,
now we just tell new windows they're unfocused to draw the border on
first render.
This allows the user to configure which component (title, wm_info, clock)
is rendered to which part of the bar (left, right, center).
You can also use `none` to hide the location.
This lets the user change to any time format they want in the bar.
As part of this, we also change the bar to re-draw every second (to
allow using seconds in the time format string).
This commit adds the focused window title to the left side of the bar
and some WM info (primary count/ratio and # of visible/total windows) to
the right side.
It also adds new vertical_padding and horizontal_padding config options
for the bar.
Without this, if you had a config with no bar, added the bar, then
reloaded the config, its geometry would never be created because of the
early return in Bar.manage(), so nothing would ever get drawn.
I want to implement more functionality to the bar, similar to what
machi has in its bar, but it seems a lot easier to just handle the bar
with the rest of the manage/render loop that rwm and beansprout use.
To do that, I had to convert the bar to use river-shell-surface instead
of zwlr-layer-shell.
In that process, I also removed support for zwlr-layer-shell exclusive
zones. It made calculating the usable area for the layout more annoying.
If someone *really* wants, I would consider adding it back, but the only
thing I can think of that requires exclusive area is a bar, and we don't
really support other bars, so I don't think it's needed.
I also switched a couple of places to use saturating subtraction on
unsigned ints.