[evolution] Bug 731758 - [webkit-composer] Formatting/fonts not reset on paste into plain text



commit ef20971fd3b7d8c9f47313e5686b4cd5103aa8ed
Author: Tomas Popela <tpopela redhat com>
Date:   Tue Jun 17 14:10:50 2014 +0200

    Bug 731758 - [webkit-composer] Formatting/fonts not reset on paste into plain text
    
    The cause of this bug was that WebKitWebView is not emitting signal
    paste-clipboard for Shift + Insert (neither for Ctrl + Insert for copy
    or Shift + Delete for cut) so we didn't get a change to process the
    content of clipboard. As a workaround we are emitting paste-clipboard signal
    when we trigger these shortcuts.

 composer/e-msg-composer.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 46705f2..3660d52 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -2378,6 +2378,21 @@ msg_composer_key_press_event (GtkWidget *widget,
                return TRUE;
        }
 
+       if (((event)->state & GDK_SHIFT_MASK) && ((event)->keyval == GDK_KEY_Insert)) {
+               g_signal_emit_by_name (WEBKIT_WEB_VIEW (view), "paste-clipboard");
+               return TRUE;
+       }
+
+       if (((event)->state & GDK_CONTROL_MASK) && ((event)->keyval == GDK_KEY_Insert)) {
+               g_signal_emit_by_name (WEBKIT_WEB_VIEW (view), "copy-clipboard");
+               return TRUE;
+       }
+
+       if (((event)->state & GDK_SHIFT_MASK) && ((event)->keyval == GDK_KEY_Delete)) {
+               g_signal_emit_by_name (WEBKIT_WEB_VIEW (view), "cut-clipboard");
+               return TRUE;
+       }
+
        /* Chain up to parent's key_press_event() method. */
        return GTK_WIDGET_CLASS (e_msg_composer_parent_class)->
                key_press_event (widget, event);


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