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 /e-util | |
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.
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-html-editor-actions.c | 20 |
1 files changed, 9 insertions, 11 deletions
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) }, |