diff options
author | Pranav Kant <pranav913@gmail.com> | 2015-05-08 19:19:57 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-05-08 15:01:22 +0000 |
commit | 40ad68bbe7cd1c86a8ebefb1539fb7b403506792 (patch) | |
tree | 80b81be0bc8e006ad0effb4364039f0452c4b278 | |
parent | aa50b1c03f18a10c281786c69e24d8255613ac5a (diff) |
gtktiledviewer: Stop event propagation to GtkToolbar when in edit mode
If not stopped, key-press events are interpreted by both LOKDocView and
GtkToolbar leading to poor editing experience.
Change-Id: Ie878d168e202a0f3e1d52191aa3fd7cc00a7cbfd
Reviewed-on: https://gerrit.libreoffice.org/15677
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx index 14cf7674773d..cb84ee718448 100644 --- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx @@ -132,12 +132,17 @@ void toggleFindbar(GtkWidget* /*pButton*/, gpointer /*pItem*/) } /// Handles the key-press-event of the window. -static void signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointer pData) +static gboolean signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointer pData) { + LOKDocView* pLOKDocView = LOK_DOCVIEW(pDocView); #if GTK_CHECK_VERSION(2,18,0) // we need gtk_widget_get_visible() - if (!gtk_widget_get_visible(pFindbar)) - lok_docview_post_key(pWidget, pEvent, pData); + if (!gtk_widget_get_visible(pFindbar) && bool(lok_docview_get_edit(pLOKDocView))) + { + lok_docview_post_key(pWidget, pEvent, pData); + return TRUE; + } #endif + return FALSE; } /// Searches for the next or previous text of pFindbarEntry. |