The mouse reporting functions are called from input when we receive
Wayland mouse events.
We used to pass the current keyboard modifier (shift, alt, ctrl, etc)
to the terminal functions.
This however is wrong, since we may receive Wayland mouse events
without having keyboard focus. When we don't have keyboard focus, the
modifier state doesn't apply to us.
Remove the modifier arguments from the terminal mouse reporting
functions. These functions now read this state directly instead, but
only when the terminal instance in question has keyboard focus.
When this returns true, it means we have keyboard focus and are
grabbing the mouse (for e.g. selections), regardless of whether the
client has enabled mouse tracking or not.
There were two errors:
* We subtracted half the line width instead of adding it to the
baseline
* We rounded the line positioning and thickness before the positioning
calculation. In particular, rounding the thickness before using it
to adjust the position was wrong. Now we round just before the
pixman call.
This is what we used as baseline for regular glyphs anyway. Thus, we
can update that code to call font_baseline() now. This makes it easier
to change how we define the baseline in the future.
We may have many windows open, which tries to update/change the
xcursor at various points.
Track which cursor is currently loaded, regardless of which window it
was set by. If someone tries to load that very same xcursor again,
simply skip it.
One example is when we've moused over a window that does *not* have
keyboard focus, and then the user clicks, or by some other mean gives
that window keyboard focus. In many cases it will then try to set the
same cursor again (most of the times, the cursor is the same
regardless of keyboard focus, but not always).
Instead of duplicating the code from selection_enabled() that deals
with forced selection, just call selection_enabled().
This was previously not possible since selection_enabled() didn't
require keyboard_focus. Now it does.
Up the requirements for enabling "forced" selection (that is, allowing
selections even though mouse tracking has been disabled).
* Require keyboard focus (if we don't have it, then the shift-key
isn't is for us)
* Don't just require shift being pressed, but that all other modifiers
are *not* pressed.
When we insert an auto-newline, we must make sure we don't try to move
outside the terminal window.
This can for example happen when a scrolling region have been
configured, and the cursor is **outside** the scrolling
region (i.e. it's in the bottom margin).
Having them as error messages was nice when we where still missing
lots of sequences.
Now we don't anymore, and these just spam stdout as well as syslog
when e.g. cat:ing binary data.
In most states, most 8-bit values are no-ops. This is already handled;
action() recognizes ACTION_NONE as a no-op. Thus, all we need to do is
remove the assertion.
Show 'text' cursor when:
* we have no mouse tracking enabled
* forced selection has been enabled (shift being held down)
* We're *not* scrollback searching
In all other cases, show the 'left_ptr' cursor.