From 185dab41758fee4ee291d714ae8dc237316752e3 Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Fri, 31 Aug 2012 16:52:40 +0200 Subject: ephy-notebook: be more careful with event coordinates on right click The code assumed clicks would happen in the tab label area, but this is not always the case (for instance when our child forwards an event to us). So always check the button press is actually within the tab allocation rectangle before acting on it. --- src/ephy-notebook.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index 6a43412f0..2fb091482 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -246,15 +246,7 @@ find_tab_num_at_pos (EphyNotebook *notebook, gint abs_x, gint abs_y) max_x = x_root + allocation.x + allocation.width; max_y = y_root + allocation.y + allocation.height; - if (((tab_pos == GTK_POS_TOP) - || (tab_pos == GTK_POS_BOTTOM)) - &&(abs_x<=max_x)) - { - return page_num; - } - else if (((tab_pos == GTK_POS_LEFT) - || (tab_pos == GTK_POS_RIGHT)) - && (abs_y<=max_y)) + if (abs_y <= max_y && abs_x <= max_x) { return page_num; } -- cgit v1.2.3