summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorFabien Freling <fabien.freling@nokia.com>2010-03-03 11:45:14 (GMT)
committerFabien Freling <fabien.freling@nokia.com>2010-03-03 11:45:14 (GMT)
commit3335721dcf72cda957ba0e507608d795cab3f1ab (patch)
treeff307de373fb44794f46113beac676fb646e9740 /src/gui/kernel
parent4504be1fc8f6cda2bb9ee0c9e01cd1bc3bb13b69 (diff)
downloadQt-3335721dcf72cda957ba0e507608d795cab3f1ab.zip
Qt-3335721dcf72cda957ba0e507608d795cab3f1ab.tar.gz
Qt-3335721dcf72cda957ba0e507608d795cab3f1ab.tar.bz2
Fix focus behavior bug on Mac OS X.
With the Full Access Keyboard enabled, the focus could sometimes be stolen by the window.
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index a1dcc2a..f7cb21f 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -1028,7 +1028,10 @@ static int qCocoaViewCount = 0;
{
if (!qwidget)
return NO;
- if (qwidget->isWindow())
+ // Before accepting the focus for a window, we check that
+ // the focusWidget (if any) is not contained in the same window.
+ if (qwidget->isWindow() && (!qApp->focusWidget()
+ || qApp->focusWidget()->window() != qwidget))
return YES; // Always do it, so that windows can accept key press events.
return qwidget->focusPolicy() != Qt::NoFocus;
}