From 04bdc935dfa2df5006ca2d8f19b4aa83901506f1 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Wed, 25 Jun 2014 11:41:04 +0200 Subject: 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. --- e-util/e-html-editor-actions.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'e-util/e-html-editor-actions.c') 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"), - "v", + NULL, /* Widgets are treating Ctrl + v shortcut themselves */ N_("Paste text from the clipboard"), G_CALLBACK (action_paste_cb) }, -- cgit v1.2.3