Resolves: tdf#134939 don't update IM position if focus is in another widget
Change-Id: Ia078ed9c1896d4a3541525ea2907760ce235dfd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104466
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index e7e3f96..d145744 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -3188,10 +3188,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)
{
if (!gtk_widget_get_realized(pFocusWindow))
return true;
@@ -3306,7 +3309,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;