static void
midori_view_ensure_link_uri (MidoriView* view,
gint *x,
- gint *y)
+ gint *y,
+ GdkEventButton* event)
{
g_return_if_fail (MIDORI_IS_VIEW (view));
#if WEBKIT_CHECK_VERSION (1, 1, 15)
if (view->web_view && gtk_widget_get_window (view->web_view))
{
- gint ex, ey;
- GdkEventButton event;
+ GdkEventButton ev;
+
+ if (!event) {
+ gint ex, ey;
+ event = &ev;
+ gdk_window_get_pointer (gtk_widget_get_window (view->web_view), &ex, &ey, NULL);
+ event->x = ex;
+ event->y = ey;
+ }
- gdk_window_get_pointer (gtk_widget_get_window (view->web_view), &ex, &ey, NULL);
if (x != NULL)
- *x = ex;
+ *x = event->x;
if (y != NULL)
- *y = ey;
+ *y = event->y;
- event.x = ex;
- event.y = ey;
katze_object_assign (view->hit_test,
g_object_ref (
webkit_web_view_get_hit_test_result (
- WEBKIT_WEB_VIEW (view->web_view), &event)));
+ WEBKIT_WEB_VIEW (view->web_view), event)));
katze_assign (view->link_uri,
katze_object_get_string (view->hit_test, "link-uri"));
}
gboolean background;
event->state = event->state & MIDORI_KEYS_MODIFIER_MASK;
- midori_view_ensure_link_uri (view, NULL, NULL);
+ midori_view_ensure_link_uri (view, NULL, NULL, event);
link_uri = midori_view_get_link_uri (view);
switch (event->button)
gboolean is_image;
gboolean is_media;
- midori_view_ensure_link_uri (view, &x, &y);
+ midori_view_ensure_link_uri (view, &x, &y, NULL);
context = katze_object_get_int (view->hit_test, "context");
has_selection = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION;
/* Ensure view->selected_text */