gchar* statusbar_text;
WebKitHitTestResult* hit_test;
gchar* link_uri;
+ gboolean button_press_handled;
gboolean has_selection;
gchar* selected_text;
MidoriWebSettings* settings;
| GDK_MOD1_MASK | GDK_META_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK )
static gboolean
-gtk_widget_button_press_event_cb (WebKitWebView* web_view,
- GdkEventButton* event,
- MidoriView* view)
+midori_view_web_view_button_press_event_cb (WebKitWebView* web_view,
+ GdkEventButton* event,
+ MidoriView* view)
{
GtkClipboard* clipboard;
gchar* uri;
event->state = event->state & MIDORI_KEYS_MODIFIER_MASK;
midori_view_ensure_link_uri (view, NULL, NULL, event);
link_uri = midori_view_get_link_uri (view);
+ view->button_press_handled = FALSE;
switch (event->button)
{
if (MIDORI_MOD_BACKGROUND (event->state))
background = !background;
g_signal_emit (view, signals[NEW_TAB], 0, link_uri, background);
+ view->button_press_handled = TRUE;
return TRUE;
}
else if (MIDORI_MOD_NEW_WINDOW (event->state))
{
/* Open link in new window */
g_signal_emit (view, signals[NEW_WINDOW], 0, link_uri);
+ view->button_press_handled = TRUE;
return TRUE;
}
break;
if (MIDORI_MOD_BACKGROUND (event->state))
background = !background;
g_signal_emit (view, signals[NEW_TAB], 0, link_uri, background);
+ view->button_press_handled = TRUE;
return TRUE;
}
else if (MIDORI_MOD_SCROLL (event->state))
gtk_widget_grab_focus (GTK_WIDGET (view));
}
g_free (uri);
+ view->button_press_handled = TRUE;
return TRUE;
}
}
midori_view_populate_popup (view, menu, TRUE);
katze_widget_popup (GTK_WIDGET (web_view), GTK_MENU (menu), event,
KATZE_MENU_POSITION_CURSOR);
+ view->button_press_handled = TRUE;
return TRUE;
}
break;
case 8:
midori_view_go_back (view);
+ view->button_press_handled = TRUE;
return TRUE;
case 9:
midori_view_go_forward (view);
+ view->button_press_handled = TRUE;
return TRUE;
/*
* On some fancier mice the scroll wheel can be used to scroll horizontally.
* accidentally being interpreted as first button clicks.
*/
case 11:
- return TRUE;
case 12:
+ view->button_press_handled = TRUE;
return TRUE;
}
return FALSE;
}
+static gboolean
+midori_view_web_view_button_release_event_cb (WebKitWebView* web_view,
+ GdkEventButton* event,
+ MidoriView* view)
+{
+ gboolean button_press_handled = view->button_press_handled;
+ view->button_press_handled = FALSE;
+
+ return button_press_handled;
+}
+
static gboolean
midori_view_inspector_window_key_press_event_cb (GtkWidget* window,
GdkEventKey* event,
"signal::hovering-over-link",
webkit_web_view_hovering_over_link_cb, view,
"signal::button-press-event",
- gtk_widget_button_press_event_cb, view,
+ midori_view_web_view_button_press_event_cb, view,
+ "signal::button-release-event",
+ midori_view_web_view_button_release_event_cb, view,
"signal-after::key-press-event",
gtk_widget_key_press_event_cb, view,
"signal::scroll-event",