[epiphany] ephy-web-view: be precise in what modifiers to catch



commit 0e3eaec0ea23d4e4b2c006c82d92bb8a4027a726
Author: Diego Escalante Urrelo <descalante igalia com>
Date:   Tue Feb 16 01:48:56 2010 -0500

    ephy-web-view: be precise in what modifiers to catch
    
    In ephy_web_view_button_press_event we are being too liberal with "&" when
    checking for modifiers, we want == so we don't prevent handling elsewhere.
    Also explain the function a bit more.
    
    Bug #604950

 embed/ephy-web-view.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 4de5938..7f2a493 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -519,14 +519,18 @@ ephy_web_view_key_press_event (GtkWidget *widget, GdkEventKey *event)
 static gboolean
 ephy_web_view_button_press_event (GtkWidget *widget, GdkEventButton *event)
 {
-  /* We always show the browser context menu on control-rightclick */
-  if (event->button == 3 && event->state & GDK_CONTROL_MASK)
+  /* This are the special cases WebkitWebView doesn't handle but we have an
+   * interest in handling. */
+
+  /* We always show the browser context menu on control-rightclick. */
+  if (event->button == 3 && event->state == GDK_CONTROL_MASK)
     return FALSE;
 
-  /* We use this for downloading */
-  if (event->button == 1 && event->state & GDK_SHIFT_MASK)
+  /* We use this for downloading. */
+  if (event->button == 1 && event->state == GDK_SHIFT_MASK)
     return FALSE;
 
+  /* Let WebKitWebView handle this. */
   return GTK_WIDGET_CLASS (ephy_web_view_parent_class)->button_press_event (widget, event);
 }
 



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