mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-23 01:40:12 -05:00
input: margins are not selectable
* Fix col/row calculation in pointer-enter event; we did not take the margins into account. * seat->mouse.col,row are now set to -1 if the cursor is inside the margins. That is, col/row are only ever valid when the mouse is actually over the grid, and not in the margins. * Use regular 'left-ptr' mouse cursor when mouse is inside the margins, to not make the user think he/she can start a selection. Besides making things clearer, this also fixes a crash that occurred if you started a selection in e.g. the right margin.
This commit is contained in:
parent
363a0de8b9
commit
d675cf8720
3 changed files with 39 additions and 17 deletions
|
|
@ -25,9 +25,10 @@ bool
|
|||
selection_enabled(const struct terminal *term, struct seat *seat)
|
||||
{
|
||||
return
|
||||
term->mouse_tracking == MOUSE_NONE ||
|
||||
term_mouse_grabbed(term, seat) ||
|
||||
term->is_searching;
|
||||
seat->mouse.col >= 0 && seat->mouse.row >= 0 &&
|
||||
(term->mouse_tracking == MOUSE_NONE ||
|
||||
term_mouse_grabbed(term, seat) ||
|
||||
term->is_searching);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue