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

Caolán McNamara caolanm at redhat.com
Thu Jul 23 01:56:07 PDT 2015


 vcl/unx/gtk/window/gtksalframe.cxx |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 57ec66e294b1405a85029aa1f1c0e9485ad4e5b4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jul 23 09:55:01 2015 +0100

    Resolves: tdf#92689 grab keyboard focus to parent, not to earlier generations
    
    Change-Id: I4c95f52f0b22ab574f608b93c172e0398e81974b

diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 2cb31bc..5944b6b 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -1927,9 +1927,7 @@ void GtkSalFrame::Show( bool bVisible, bool bNoActivate )
                 if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 1 )
                 {
                     grabPointer(true, true);
-                    GtkSalFrame *pKeyboardFrame = this;
-                    while (pKeyboardFrame->m_pParent)
-                        pKeyboardFrame = pKeyboardFrame->m_pParent;
+                    GtkSalFrame *pKeyboardFrame = m_pParent ? m_pParent : this;
                     pKeyboardFrame->grabKeyboard(true);
                 }
                 // #i44068# reset parent's IM context
@@ -1946,9 +1944,7 @@ void GtkSalFrame::Show( bool bVisible, bool bNoActivate )
                 m_nFloats--;
                 if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 0)
                 {
-                    GtkSalFrame *pKeyboardFrame = this;
-                    while (pKeyboardFrame->m_pParent)
-                        pKeyboardFrame = pKeyboardFrame->m_pParent;
+                    GtkSalFrame *pKeyboardFrame = m_pParent ? m_pParent : this;
                     pKeyboardFrame->grabKeyboard(false);
                     grabPointer(false);
                 }


More information about the Libreoffice-commits mailing list