From 5412ae7251844b503828d2fd769ef679c4f8ee41 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 6 Jul 2011 10:30:58 +0000 Subject: Use prescribed method for discovering browser window position. svn path=/trunk/netsurf/; revision=12572 --- desktop/textinput.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'desktop/textinput.c') diff --git a/desktop/textinput.c b/desktop/textinput.c index 653d906e5..7a3983ab7 100644 --- a/desktop/textinput.c +++ b/desktop/textinput.c @@ -1179,22 +1179,11 @@ void browser_window_place_caret(struct browser_window *bw, int pos_y = 0; /* Find top level browser window */ - root_bw = bw; - while (root_bw && !root_bw->window && root_bw->parent) { - switch (root_bw->browser_window_type) { - default: - /* TODO: Frame(set)s */ - case BROWSER_WINDOW_NORMAL: - break; - case BROWSER_WINDOW_IFRAME: - box_coords(root_bw->box, &pos_x, &pos_y); - x += pos_x; - y += pos_y; - break; - } + root_bw = browser_window_get_root(bw); + browser_window_get_position(bw, true, &pos_x, &pos_y); - root_bw = root_bw->parent; - } + x = x * bw->scale + pos_x; + y = y * bw->scale + pos_y; gui_window_place_caret(root_bw->window, x, y, height); bw->caret_callback = caret_cb; -- cgit v1.2.3