[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 23 16:07:38 UTC 2020


 vcl/unx/gtk3/gtk3gtkinst.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit ffa9ff82335765844ea5c5fcac67c38d53b5350a
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Oct 23 13:08:25 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Oct 23 18:06:59 2020 +0200

    call gtk_im_context_focus_in only if its widget has focus
    
    Change-Id: Ib69b43b5247f34ccf36591b49a35d701a3715f82
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104721
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index fd4c339f5337..46baaf4bc6cf 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -13714,7 +13714,8 @@ public:
             gtk_widget_realize(pWidget);
         GdkWindow* pWin = gtk_widget_get_window(pWidget);
         gtk_im_context_set_client_window(m_pIMContext, pWin);
-        gtk_im_context_focus_in(m_pIMContext);
+        if (gtk_widget_has_focus(m_pArea->getWidget()))
+            gtk_im_context_focus_in(m_pIMContext);
     }
 
     void signalFocus(bool bIn)
@@ -13746,6 +13747,9 @@ public:
         g_signal_handler_disconnect(m_pArea->getWidget(), m_nFocusOutSignalId);
         g_signal_handler_disconnect(m_pArea->getWidget(), m_nFocusInSignalId);
 
+        if (gtk_widget_has_focus(m_pArea->getWidget()))
+            gtk_im_context_focus_out(m_pIMContext);
+
         // first give IC a chance to deinitialize
         gtk_im_context_set_client_window(m_pIMContext, nullptr);
         // destroy old IC


More information about the Libreoffice-commits mailing list