[epiphany] ephy-notebook: be more careful with event coordinates on right click



commit 185dab41758fee4ee291d714ae8dc237316752e3
Author: Xan Lopez <xan igalia com>
Date:   Fri Aug 31 16:52:40 2012 +0200

    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 files changed, 1 insertions(+), 9 deletions(-)
---
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index 6a43412..2fb0914 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;
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]