Button positions are off in both the x and y directions.
This can be easily seen if we set the thickness of button borders
to 1 and set all the other margins, paddings, border thicknesses
and button gaps to 0.
Then, in the y direction, there is an one-pixel gap between the top
of swaynag and the top button borders, while the bottom button borders
are invisible. In the x direction, the right border of the dismiss
button is invisible, while the borders of adjacent buttons overlap
by one pixel.
Fixed by removing the explicit one-pixel offsets in the assignment
statements for button->x and button-y in the render_button function.
In addition to removing unused code, two minor problems are fixed:
(1) `resize set` and `resize adjust` did not error when given
too many arguments.
(2) `orientation` was incorrectly overridden to be 'U' for
scroll events in the swaybar tray `handle_click` function.
This commit mostly duplicates the wlr_log functions, although
with a sway_* prefix. (This is very similar to PR #2009.)
However, the logging function no longer needs to be replaceable,
so sway_log_init's second argument is used to set the exit
callback for sway_abort.
wlr_log_init is still invoked in sway/main.c
This commit makes it easier to remove the wlroots dependency for
the helper programs swaymsg, swaybg, swaybar, and swaynag.
This does the following:
* Adds a baseline argument to get_text_size (the baseline is the
distance from the top of the texture to the baseline).
* Stores the baseline in the container when calculating the title
height.
* Takes the baseline into account when calculating the config's max font
height.
* When rendering, pads the textures according to the baseline so they
line up.