mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-03 07:15:29 -04:00
terminal: use the 'text' xcursor pointer whenever selection is possible
This commit is contained in:
parent
729ba8b8ac
commit
0dd37f0a36
6 changed files with 72 additions and 36 deletions
14
terminal.c
14
terminal.c
|
|
@ -483,6 +483,7 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
|
|||
.text = conf->cursor.color.text,
|
||||
.cursor = conf->cursor.color.cursor,
|
||||
},
|
||||
.xcursor = "text",
|
||||
.selection = {
|
||||
.start = {-1, -1},
|
||||
.end = {-1, -1},
|
||||
|
|
@ -1429,6 +1430,19 @@ term_mouse_motion(struct terminal *term, int button, int row, int col,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
term_xcursor_update(struct terminal *term)
|
||||
{
|
||||
const bool is_focused = term->wl->focused == term;
|
||||
const char *new_cursor =
|
||||
is_focused && selection_enabled(term) ? "text" : "left_ptr";
|
||||
|
||||
LOG_DBG("setting xcursor to '%s' for term=%p", new_cursor, term);
|
||||
|
||||
term->xcursor = new_cursor;
|
||||
wayl_cursor_set(term->wl, term);
|
||||
}
|
||||
|
||||
void
|
||||
term_set_window_title(struct terminal *term, const char *title)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue