From 6108d210d508e754904c46f687adbc87ab98dc78 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 23 May 2020 22:59:40 +0100 Subject: remove all direct access to selection structure --- content/handlers/html/interaction.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'content/handlers/html/interaction.c') diff --git a/content/handlers/html/interaction.c b/content/handlers/html/interaction.c index 0a963dd54..79846ae6a 100644 --- a/content/handlers/html/interaction.c +++ b/content/handlers/html/interaction.c @@ -1247,7 +1247,7 @@ default_mouse_action(html_content *html, selection_clear(&html->sel, true); } - if (selection_defined(&html->sel)) { + if (selection_active(&html->sel)) { sel_owner.none = false; html_set_selection(html, HTML_SELECTION_SELF, @@ -1586,13 +1586,8 @@ bool html_keypress(struct content *c, uint32_t key) return true; case NS_KEY_ESCAPE: - if (selection_defined(sel)) { - selection_clear(sel, true); - return true; - } - /* if there's no selection, leave Escape for the caller */ - return false; + return selection_clear(sel, true); } return false; -- cgit v1.2.3