diff options
author | Tomas Popela <tpopela@redhat.com> | 2014-06-25 17:41:04 +0800 |
---|---|---|
committer | Tomas Popela <tpopela@redhat.com> | 2014-06-25 21:59:50 +0800 |
commit | 04bdc935dfa2df5006ca2d8f19b4aa83901506f1 (patch) | |
tree | 4084e35dc0a279a7f3c94516300e9ef757cf2546 | |
parent | 93c1357da29c068d1418f8bd07b58b55d05f5c0b (diff) | |
download | gsoc2013-evolution-04bdc935dfa2df5006ca2d8f19b4aa83901506f1.tar gsoc2013-evolution-04bdc935dfa2df5006ca2d8f19b4aa83901506f1.tar.gz gsoc2013-evolution-04bdc935dfa2df5006ca2d8f19b4aa83901506f1.tar.bz2 gsoc2013-evolution-04bdc935dfa2df5006ca2d8f19b4aa83901506f1.tar.lz gsoc2013-evolution-04bdc935dfa2df5006ca2d8f19b4aa83901506f1.tar.xz gsoc2013-evolution-04bdc935dfa2df5006ca2d8f19b4aa83901506f1.tar.zst gsoc2013-evolution-04bdc935dfa2df5006ca2d8f19b4aa83901506f1.zip |
Bug 731507 - [webkit-composer] paste does not work, shift-ins or CTRL-V works
Together with previous commit that removes the usage of deprecated
gtk-stock items and unregistering the Ctrl+v shorcut this solves the
issue. When the action is triggered and WebView doesn't have focus we have
to focus it to insert the clipboard content there.
-rw-r--r-- | composer/e-msg-composer.c | 6 | ||||
-rw-r--r-- | e-util/e-html-editor-actions.c | 20 |
2 files changed, 13 insertions, 13 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index b81a764769..2489a2e137 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -2422,8 +2422,10 @@ msg_composer_key_press_event (GtkWidget *widget, return TRUE; } - if (((event)->state & GDK_SHIFT_MASK) && - ((event)->keyval == GDK_KEY_Insert)) { + if ((((event)->state & GDK_SHIFT_MASK) && + ((event)->keyval == GDK_KEY_Insert)) || + (((event)->state & GDK_CONTROL_MASK) && + ((event)->keyval == GDK_KEY_v))) { g_signal_emit_by_name ( WEBKIT_WEB_VIEW (view), "paste-clipboard"); return TRUE; diff --git a/e-util/e-html-editor-actions.c b/e-util/e-html-editor-actions.c index 94f2493d72..4d1751e117 100644 --- a/e-util/e-html-editor-actions.c +++ b/e-util/e-html-editor-actions.c @@ -696,24 +696,22 @@ action_paste_cb (GtkAction *action, { EHTMLEditorView *view = e_html_editor_get_view (editor); - /* Paste only if WebView has focus */ - if (gtk_widget_has_focus (GTK_WIDGET (view))) { - webkit_web_view_paste_clipboard ( - WEBKIT_WEB_VIEW (view)); + /* If WebView doesn't have focus, focus it */ + if (gtk_widget_has_focus (GTK_WIDGET (view))) + gtk_widget_grab_focus (GTK_WIDGET (view)); - e_html_editor_view_force_spell_check (view); - } + webkit_web_view_paste_clipboard (WEBKIT_WEB_VIEW (view)); + e_html_editor_view_force_spell_check (view); } static void action_paste_quote_cb (GtkAction *action, EHTMLEditor *editor) { - e_html_editor_view_paste_clipboard_quoted ( - e_html_editor_get_view (editor)); + EHTMLEditorView *view = e_html_editor_get_view (editor); - e_html_editor_view_force_spell_check ( - e_html_editor_get_view (editor)); + e_html_editor_view_paste_clipboard_quoted (view); + e_html_editor_view_force_spell_check (view); } static void @@ -961,7 +959,7 @@ static GtkActionEntry core_entries[] = { { "paste", "edit-paste", N_("_Paste"), - "<Control>v", + NULL, /* Widgets are treating Ctrl + v shortcut themselves */ N_("Paste text from the clipboard"), G_CALLBACK (action_paste_cb) }, |