From f23fd2a0945b4d178eff39413b68528a951b8775 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sat, 17 Jul 2004 23:32:09 +0000 Subject: [project @ 2004-07-17 23:32:08 by bursa] Rewrite and simplify mouse click handling. svn path=/import/netsurf/; revision=1094 --- riscos/window.c | 40 ++++++---------------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) (limited to 'riscos/window.c') diff --git a/riscos/window.c b/riscos/window.c index 2c86918d1..01de4839d 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -908,14 +908,7 @@ void ro_gui_window_mouse_at(struct gui_window *g, wimp_pointer *pointer) x = window_x_units(pointer->pos.x, &state) / 2 / g->option.scale; y = -window_y_units(pointer->pos.y, &state) / 2 / g->option.scale; - if (g->bw->current_content != NULL) - { - struct browser_action msg; - msg.type = act_MOUSE_AT; - msg.data.mouse.x = x; - msg.data.mouse.y = y; - browser_window_action(g->bw, &msg); - } + browser_window_mouse_click(g->bw, BROWSER_MOUSE_HOVER, x, y); } @@ -1034,7 +1027,6 @@ void ro_gui_status_click(struct gui_window *g, wimp_pointer *pointer) void ro_gui_window_click(struct gui_window *g, wimp_pointer *pointer) { - struct browser_action msg; int x, y; wimp_window_state state; os_error *error; @@ -1066,33 +1058,13 @@ void ro_gui_window_click(struct gui_window *g, wimp_pointer *pointer) } } - if (pointer->buttons == wimp_CLICK_MENU) { + if (pointer->buttons == wimp_CLICK_MENU) ro_gui_create_menu(browser_menu, pointer->pos.x - 64, pointer->pos.y, g); - return; - } - - if (pointer->buttons == wimp_CLICK_SELECT) { - msg.type = act_MOUSE_CLICK; - msg.data.mouse.x = x; - msg.data.mouse.y = y; - if (browser_window_action( - g->bw, &msg) == 1) - return; - msg.type = act_UNKNOWN; - } - - if (pointer->buttons == wimp_CLICK_SELECT - || pointer->buttons == wimp_CLICK_ADJUST) { - - if (pointer->buttons == wimp_CLICK_SELECT) - msg.type = act_FOLLOW_LINK; - else - msg.type = act_FOLLOW_LINK_NEW_WINDOW; - msg.data.mouse.x = x; - msg.data.mouse.y = y; - browser_window_action(g->bw, &msg); - } + else if (pointer->buttons == wimp_CLICK_SELECT) + browser_window_mouse_click(g->bw, BROWSER_MOUSE_CLICK_1, x, y); + else if (pointer->buttons == wimp_CLICK_ADJUST) + browser_window_mouse_click(g->bw, BROWSER_MOUSE_CLICK_2, x, y); } -- cgit v1.2.3