This is done by update_size(). Setting it in xdg_output_handle_done()
causes update_size() to do an early exit, and thus we end up never
actually configuring the surface.
We also never instantiate a pixman image, which led to a hard crash at
startup when the user had configured a specific output to use.
This allows the backend to support multi-seat "properly", by checking
against the correct seat. Before this, when we used a single, global
xcursor value, a seat whose pointer needed to be updated would not be
updated.
Instead, roundtrip once all globals have been handled. This means all
listeners have been registered.
When we detect a specific monitor to map to, and it has a non-default
scale, update the cursor theme (since it depends on the scale).
We only care about the mouse. We now track per-seat cursor positions
and cursor themes.
Any enter/leave/motion/button event will call the bar on_mouse()
method using the coordinates from the "current" seat.
Since the bar framework doesn't deal with multi-seats at all, we
internally, in the backend, track the currently active seat. This is
the seat which we last saw any kind of events from.
This is used in e.g. set_cursor(), which is called from the bar.
wl_display_dispatch() calls poll(), which is unnecessary since we
already know the FD is readable.
Use the more lower level wl_display_read_events() +
wl_display_dispatch_pending().
These require wl_display_prepare_read() to have been called.
Instead of us selecting an output randomly (we used to select that
"last" output) when the user hasn't configured one, let the compositor
choose one for us.
This is trivial in the Wayland backend; just instantiate a pixman
pointing to the same mmapped memory as the wayland buffer.
In the XCB backend, we change the implementation slightly; instead of
rendering via a cairo XCB surface backend (to a server side pixmap),
which is then blitted to the window in commit(), we now render to a
client-side pixman pixmap, and blit it using xcb_put_image() in
commit().
All decoration, particle and module interfaces now takes a
pixman_image_t parameter, and all drawing is done using pixman APIs.
The wayland/xcb backends implement a new interface functions,
get_pixman_image(), that should return a pixman image instance that is
suitable for rendering.
In the wayland backend, the image uses the same backing data as the
cairo surface.
In the XCB backend, we create a new image each time, and then blit it
to the cairo surface at commit time.
We do it differently from everybody else...
A traditional HiDPI implementation typically scales up
everything. I.e. if the user wants a 1px border, it's scaled up to
2px. The wayland server typically presents an output width/height that
has been scaled *down*.
This is all a bit backwards, but perhaps was the best choice to make
legacy applications at least work.
f00bar on the other hand, wants to give the user absolute
control. Thus, we don't scale up at all. If the user wants a 25px bar
height, that's what he gets.
This does mean however, that we need to scale *down* the surface size
since it's in logical pixels, not physical.
So we scale *down* the surface size (which then gets scaled back up by
the wayland server), and then render everything *on* that surface
without any scaling.