Some fonts, even monospaced ones, have a negative line gap (line
height < ascent + descent).
Using the font's line height as cell height will result in some glyphs
overflowing into the cell above or below.
Workaround by using which ever value is the largest: the line height
or ascent + descent.
The user can now configure the following:
* Whether to prefer CSDs or SSDs. But note that this is only a hint to
the compositor - it may deny our request. Furthermore, not all
compositors implement the decoration manager protocol, meaning CSDs
will be used regardless of the user configuration (GNOME/mutter
being the most prominent one).
* Title bar size and color, including transparency
* Border size and color, including transparency
Also drop support for rendering the CSDs inside the main surface.
Normally, we resize and update the font's DPI whenever our window
enters or leaves an output.
This is since a change in the outputs we're mapped on means the scale
factor to use, or the DPI to use for the fonts may have changed.
However, a special case is when we're removed from the last
output. This should only happen at shutdown, when we're un-mapping
ourselves.
In this case, we typically don't have a access to e.g. the PTMX
fd (often, the reason we're shutting down is because the client
exited). This resulted in (harmless) error messages when emitting the
TIOCSWINSZ event.
Since we're shutting down anyway, we can simply skip the resize and
everything. This gets rid of the error message, and also means we're
shutting down faster.
When the user left-clicks the title-bar, we start a timer. When the
timer has elapsed, we initiate a 'move' operation.
However, if the user clicked, and then started dragging right away,
there was a very visible lag since we waited for the timeout before
starting the move.
Now, on a pointer motion event we detect a running 'move' timer, and
abort it and instead start the 'move' operation right away.
I'm not sure why I added this in the first place... our cursor doesn't
depend on keyboard focus.
Furthermore, with CSDs, we may get keyboard enter events for the CSD
surfaces, and these should definitely *not* update the xcursor
as if it was inside the main surface.
If the display resolution *is* 800x600, using this size is bad since
there will typically be panels and other things on the screen too.
Not that 800x600 is something we expect to see in real life, but may
happen on virtual displays.
When resizing the window under mutter, mutter seems to expect a
configure ack *and* a surface commit *right* away, or things get out
of sync.
Unlike kwin, which is requires a commit for each configure ack, but is
fine with having the commit arrive later (after we've rendered it),
mutter is not.
I even tried delaying the configure ack until just before the commit,
but still no go.
So for now, detect when we're running under mutter and always do a
surface commit right away.
This can *not* be done on any other compositor as it breaks the CSD
and main surface synchronization; we've resized the CSDs, but not the
main surface.
I.e. this *should* not work, but for some reason is the *only* way to
make things work on mutter.
Interestingly, doing it any other way on mutter causes visual
glitches; window jumping around when resizing, or de-synchronized
CSDs/main surface.