This re-adds support for layer-shell exclusive areas (initially removed
in commit a9473204)
The Beansprout bar will now render inside the non-exclusive area and the
usable area for calculating the window layouts is based on the non-
exclusive area minus the beansprout bar's area
Implements: #13
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).
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).
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
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
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.
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.
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.
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.
They should use gpa.destroy() instead of foo.destroy() because (most) of
them have fields that may not be initialized by the first error, so
the foo.destroy() could crash.
This implements more of the text rendering and a clock was the easiest
part. I still need to add the tag bit. I'd also like to hide the tags
but still show the clock like beanclock when windows are fullscreened
parseArgs() contains all of the argument parsing logic in a single fn.
run() handles the event loop. To work with the bar, I had to re-write
the loop to use polling similar to the loop in `beanclock` instead of
just `while (true) dispatch`.