diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-10-21 12:48:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-10-22 11:19:30 +0200 |
commit | a47ab61f6f2a7959d4e14759648e766c2629497d (patch) | |
tree | c1392408c7e4b58e2cb17341dabab9d692133d2b /vcl | |
parent | d733db0165f3209b92dc84c16298e765823e0eef (diff) |
don't update IM focus-in if focus-in was in another widget
Change-Id: Ifdb2bc6ac973a067ac3e27207f6d1cacfdf2c31d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104634
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index fd18c35aec6d..26c34a09c9d4 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -3105,7 +3105,16 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f pThis->m_nKeyModifiers = ModKeyFlags::NONE; if( pThis->m_pIMHandler ) - pThis->m_pIMHandler->focusChanged( pEvent->in != 0 ); + { + bool bFocusInAnotherGtkWidget = false; + if (GTK_IS_WINDOW(pThis->m_pWindow)) + { + GtkWidget* pFocusWindow = gtk_window_get_focus(GTK_WINDOW(pThis->m_pWindow)); + bFocusInAnotherGtkWidget = pFocusWindow && pFocusWindow != GTK_WIDGET(pThis->m_pFixedContainer); + } + if (!bFocusInAnotherGtkWidget) + pThis->m_pIMHandler->focusChanged( pEvent->in != 0 ); + } // ask for changed printers like generic implementation if( pEvent->in && pSalInstance->isPrinterInit() ) @@ -3115,7 +3124,6 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f // while we have the pointer grabbed, this should not come from // the window manager. Is this an event that was still queued ? // The focus does not seem to get set inside our process - // in the meantime do not propagate focus get/lose if floats are open if( m_nFloats == 0 ) { |