This allows things like wlr-randr to work.
wlr-randr or similar can send in two new events: `output_manager_apply'
and `output_manager_test'. In output.c, their handler both call an new
`output_manager_configure' function which loops through the list of
outputs twice. The first loop applies all the requested configuration
ad checks that its not all messed up. The second loop either commits
that configuration or reverts it depending on whether it worked and
whether we're responding to a test event.
There's also now an output_manager_update function, called whenever the
output layout is changed, which copies changes from the
wlr_output_layout to the wlr_output_manager.
This is needed in order for wlroots to interpret some values (mostly
coords of absolute input events) correctly. It for example fixes how the
pointer behaves with WLR_WL_OUTPUTS=2.
In order to also map the pointer/output pair when the pointer is created
before the output, a list of pointers has to be managed, which wasn't
needed until now.
Until now, focusing a different view didn't move pointer focus to it,
even though it was under the cursor. The pointer had to move in order
to switch its focus. Similar situations should be handled after this
commit.
This targets only surfaces under kiwmi_view, thus only XDG shell. Other
surfaces to be fixed later.
The new code here is copied over from wlroots, with only small
modifications.
This commit ensures that they also cause output damage to happen and
that popups are moved into the visible area.
I browsed the source code of Sway while writing this and took a lot of
inspiration and help from there.