[evolution/wip-webkit2] Instead of button_press_event use mouse-target-changed signal from WK2
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip-webkit2] Instead of button_press_event use mouse-target-changed signal from WK2
- Date: Tue, 29 Oct 2013 15:10:53 +0000 (UTC)
commit f02e34416371f62ef288b7659be9d9638d2ca28e
Author: Tomas Popela <tpopela redhat com>
Date: Tue Oct 29 15:48:56 2013 +0100
Instead of button_press_event use mouse-target-changed signal from WK2
mail/e-mail-display.c | 31 +++++++++++++------------------
1 files changed, 13 insertions(+), 18 deletions(-)
---
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index d719d4a..c6c0d0f 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -1085,19 +1085,17 @@ mail_display_style_updated (GtkWidget *widget)
style_updated (widget);
}
-static gboolean
-mail_display_button_press_event (GtkWidget *widget,
- GdkEventButton *event)
+static void
+mail_display_mouse_target_changed_cb (EMailDisplay *display,
+ WebKitHitTestResult *hit_test_result,
+ guint modifiers,
+ gpointer user_data)
{
- EWebView *web_view = E_WEB_VIEW (widget);
- WebKitHitTestResult *hit_test;
+ EWebView *web_view = E_WEB_VIEW (display);
GList *list, *link;
- if (event->button != 3)
- goto chainup;
-
- hit_test = webkit_web_view_get_hit_test_result (
- WEBKIT_WEB_VIEW (web_view), event);
+ if (!(modifiers & GDK_BUTTON3_MASK))
+ return;
list = e_extensible_list_extensions (
E_EXTENSIBLE (web_view), E_TYPE_EXTENSION);
@@ -1108,16 +1106,9 @@ mail_display_button_press_event (GtkWidget *widget,
continue;
e_mail_display_popup_extension_update_actions (
- E_MAIL_DISPLAY_POPUP_EXTENSION (extension), hit_test);
+ E_MAIL_DISPLAY_POPUP_EXTENSION (extension), hit_test_result);
}
g_list_free (list);
-
- g_object_unref (hit_test);
-
-chainup:
- /* Chain up to parent's button_press_event() method. */
- return GTK_WIDGET_CLASS (e_mail_display_parent_class)->
- button_press_event (widget, event);
}
static gchar *
@@ -1441,6 +1432,10 @@ e_mail_display_init (EMailDisplay *display)
display, "notify::uri",
G_CALLBACK (mail_display_uri_changed), NULL);
+ g_signal_connect (
+ display, "mouse-target-changed",
+ G_CALLBACK (mail_display_mouse_target_changed_cb), NULL);
+
display->priv->settings = g_settings_new ("org.gnome.evolution.mail");
g_signal_connect_swapped (
display->priv->settings , "changed::monospace-font",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]