diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-10-17 16:24:09 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-10-19 11:21:34 +0200 |
commit | d76e9fc4edcdf9a44cb2ed9542261064a8a76dde (patch) | |
tree | 21357e16b8c10e3bd721db30c2bf7105a5d95065 /vcl/unx | |
parent | b6be59636a142f98970d39aadff8445e1d0c39b7 (diff) |
Resolves: tdf#137201 and tdf#134939 don't update IM if focus is in another widget
Change-Id: Ia078ed9c1896d4a3541525ea2907760ce235dfd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104346
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index d818ec137096..69a554108196 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -3190,10 +3190,13 @@ gboolean GtkSalFrame::signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointe GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame); + bool bFocusInAnotherGtkWidget = false; + if (GTK_IS_WINDOW(pThis->m_pWindow)) { GtkWidget* pFocusWindow = gtk_window_get_focus(GTK_WINDOW(pThis->m_pWindow)); - if (pFocusWindow && pFocusWindow != GTK_WIDGET(pThis->m_pFixedContainer)) + bFocusInAnotherGtkWidget = pFocusWindow && pFocusWindow != GTK_WIDGET(pThis->m_pFixedContainer); + if (bFocusInAnotherGtkWidget) { gpointer pClass = g_type_class_ref(GTK_TYPE_WINDOW); GtkWidgetClass* pWindowClass = GTK_WIDGET_CLASS(pClass); @@ -3213,11 +3216,8 @@ gboolean GtkSalFrame::signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointe vcl::DeletionListener aDel( pThis ); - if( pThis->m_pIMHandler ) - { - if( pThis->m_pIMHandler->handleKeyEvent( pEvent ) ) - return true; - } + if (!bFocusInAnotherGtkWidget && pThis->m_pIMHandler && pThis->m_pIMHandler->handleKeyEvent(pEvent)) + return true; bool bStopProcessingKey = false; @@ -3306,7 +3306,7 @@ gboolean GtkSalFrame::signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointe pThis->m_nKeyModifiers = ModKeyFlags::NONE; } - if( !aDel.isDeleted() && pThis->m_pIMHandler ) + if (!bFocusInAnotherGtkWidget && !aDel.isDeleted() && pThis->m_pIMHandler) pThis->m_pIMHandler->updateIMSpotLocation(); return bStopProcessingKey; |