aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-02-08 09:06:13 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-02-08 09:06:13 +0000
commit63a50afc8e7d2b315e896f4469112f4240a1592e (patch)
tree99429f79b9df9436dcb4454c7dbd05402e03e727 /terminal.c
parentMerge branch 'xassert-performance-regression-2' (diff)
parenturl-mode: urls_render(): early exit when URL list is empty (diff)
Merge branch 'url-detection'
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/terminal.c b/terminal.c
index 701313cc..91a442ec 100644
--- a/terminal.c
+++ b/terminal.c
@@ -36,6 +36,7 @@
#include "sixel.h"
#include "slave.h"
#include "spawn.h"
+#include "url-mode.h"
#include "util.h"
#include "vt.h"
#include "xmalloc.h"
@@ -227,6 +228,8 @@ fdm_ptmx(struct fdm *fdm, int fd, int events, void *data)
cursor_blink_rearm_timer(term);
}
+ urls_reset(term);
+
uint8_t buf[24 * 1024];
ssize_t count = sizeof(buf);
@@ -1404,8 +1407,10 @@ term_destroy(struct terminal *term)
fdm_del(term->fdm, term->flash.fd);
fdm_del(term->fdm, term->ptmx);
- if (term->window != NULL)
+ if (term->window != NULL) {
wayl_win_destroy(term->window);
+ term->window = NULL;
+ }
mtx_lock(&term->render.workers.lock);
xassert(tll_length(term->render.workers.queue) == 0);
@@ -1485,6 +1490,7 @@ term_destroy(struct terminal *term)
tll_free(term->alt.sixel_images);
sixel_fini(term);
+ urls_reset(term);
term_ime_reset(term);
free(term->foot_exe);
@@ -2823,8 +2829,13 @@ term_surface_kind(const struct terminal *term, const struct wl_surface *surface)
return TERM_SURF_BUTTON_MAXIMIZE;
else if (surface == term->window->csd.surface[CSD_SURF_CLOSE])
return TERM_SURF_BUTTON_CLOSE;
- else
+ else {
+ tll_foreach(term->window->urls, it) {
+ if (surface == it->item.surf)
+ return TERM_SURF_JUMP_LABEL;
+ }
return TERM_SURF_NONE;
+ }
}
static bool
@@ -2963,3 +2974,4 @@ term_ime_set_cursor_rect(struct terminal *term, int x, int y, int width,
}
#endif
}
+