aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-28 18:35:47 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-28 18:35:47 +0000
commit0dd37f0a364fc36284dad17e8fb1345714261a4a (patch)
tree36367aa234c01ba2a0010e9917d1c9e344a1972b /terminal.c
parentinput: pointer_button: apply same workaround as in pointer_motion (diff)
terminal: use the 'text' xcursor pointer whenever selection is possible
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/terminal.c b/terminal.c
index 0cfbdb2e..22d19652 100644
--- a/terminal.c
+++ b/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},
@@ -1430,6 +1431,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)
{
free(term->window_title);