Previously, it first calculated one of the containers' next percentage, and then subtracted the previous percentage to find the actual change.
Now it directly calculates the change, and subtracts and adds the change to the two affected containers.
Added util function con_rect_size_in_orientation.
Removed px_resize_to_percent; inlined, using con_rect_size_in_orientation.
Also, prematurely return when pixel diff is 0, as no action is necessary.
This is related to [this issue on i3-gaps](https://github.com/Airblader/i3/issues/247).
Introduces resize_neighboring_cons in resize.c which is also used by
resize_graphical_handler.
Co-authored-by: Andrew Laucius <andrewla@gmail.com>
Authored original code and tests in #3240. I rewrote most of the
resizing code and fixed the failing tests.
Including config.h is necessary to get e.g. the _GNU_SOURCE define and
any other definitions that autoconf declares. Hence, config.h needs to
be included as the first header in each file.
This is done either via:
1. Including "common.h" (i3bar)
2. Including "libi3.h"
3. Including "all.h" (i3)
4. Including <config.h> directly
Also remove now-unused I3__FILE__, add copyright/license statement
where missing and switch include/all.h to #pragma once.
This is a relatively big change, however all cases should be handled by
now.
Because the function to do graphical resizing got rather large, I’ve created
a new file src/resize.c for it.
This fixes ticket #35.