From 9a92e7bdebb9886bff3f0fbdf7e5c9416588e010 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 31 Jul 2012 21:02:19 +0100 Subject: Core's gui_window_remove_caret should only remove caret if the bw in question owns the caret. --- framebuffer/gui.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/framebuffer/gui.c b/framebuffer/gui.c index cae17c52d..52d2f2532 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -1536,8 +1536,12 @@ gui_window_place_caret(struct gui_window *g, int x, int y, int height) void gui_window_remove_caret(struct gui_window *g) { - /* remove caret */ - fbtk_set_caret(g->browser, false, 0, 0, 0, NULL); + int c_x, c_y, c_h; + + if (fbtk_get_caret(g->browser, &c_x, &c_y, &c_h)) { + /* browser window owns the caret, so can remove it */ + fbtk_set_caret(g->browser, false, 0, 0, 0, NULL); + } } void -- cgit v1.2.3