summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-23 09:55:01 +0100
committerEike Rathke <erack@redhat.com>2015-07-23 14:59:19 +0000
commit6291a9c7a48023ca0f382c2e8782bf781112cc2a (patch)
tree8ad00adeacc5adb60ad7bdc02a26ec3bccdb4a9c
parent783e8d83b6c4dec7fcc0dcb8aeba705c16b3bd8e (diff)
Resolves: tdf#92689 grab keyboard focus to parent, not to earlier generations
Change-Id: I4c95f52f0b22ab574f608b93c172e0398e81974b (cherry picked from commit 57ec66e294b1405a85029aa1f1c0e9485ad4e5b4) Reviewed-on: https://gerrit.libreoffice.org/17317 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Eike Rathke <erack@redhat.com> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--vcl/unx/gtk/window/gtksalframe.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 3bee994f8f59..f193e98179b0 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -1920,9 +1920,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
@@ -1939,9 +1937,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);
}