summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-23 09:55:01 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-07-23 09:55:38 +0100
commit57ec66e294b1405a85029aa1f1c0e9485ad4e5b4 (patch)
tree703ce7881ddba841c298241e8c7be62f130bc7c2
parentbe7569acc13e90a049117b84802e92dbc4214238 (diff)
Resolves: tdf#92689 grab keyboard focus to parent, not to earlier generations
Change-Id: I4c95f52f0b22ab574f608b93c172e0398e81974b
-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 2cb31bc87c7b..5944b6bdc2ea 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);
}