vcl/unx/gtk3/gtk3gtkinst.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit ffa9ff82335765844ea5c5fcac67c38d53b5350a Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Oct 23 13:08:25 2020 +0100 Commit: Caolán McNamara <caol...@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 <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits