aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-notebook.c
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-08-31 22:52:40 +0800
committerXan Lopez <xan@igalia.com>2012-08-31 22:52:40 +0800
commit185dab41758fee4ee291d714ae8dc237316752e3 (patch)
tree01f6ed79d3f90674975ff1541835a596603aaa0a /src/ephy-notebook.c
parentaa5581ab2171dfcb83e8fa4bed0e96dfa7d45423 (diff)
downloadgsoc2013-epiphany-185dab41758fee4ee291d714ae8dc237316752e3.tar
gsoc2013-epiphany-185dab41758fee4ee291d714ae8dc237316752e3.tar.gz
gsoc2013-epiphany-185dab41758fee4ee291d714ae8dc237316752e3.tar.bz2
gsoc2013-epiphany-185dab41758fee4ee291d714ae8dc237316752e3.tar.lz
gsoc2013-epiphany-185dab41758fee4ee291d714ae8dc237316752e3.tar.xz
gsoc2013-epiphany-185dab41758fee4ee291d714ae8dc237316752e3.tar.zst
gsoc2013-epiphany-185dab41758fee4ee291d714ae8dc237316752e3.zip
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.
Diffstat (limited to 'src/ephy-notebook.c')
-rw-r--r--src/ephy-notebook.c10
1 files changed, 1 insertions, 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;
}