summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2011-02-22 08:25:53 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2011-02-22 08:25:53 (GMT)
commite32f432127bd049c6c11431055360c536e259114 (patch)
treedfaa070ae8eec36f9dd0b578de75d9f1706e227b
parent5949c215bd53582d0c6481f606a9ec015f067b37 (diff)
downloadQt-e32f432127bd049c6c11431055360c536e259114.zip
Qt-e32f432127bd049c6c11431055360c536e259114.tar.gz
Qt-e32f432127bd049c6c11431055360c536e259114.tar.bz2
Cocoa: Sheets looses focus when moving parent window
The reason seems to be that we need to be more careful what we answer when cocoa ask us if a sheet should get main window status, and if the parent window should get key status. So we add in two extra checks so we can return the correct answer. Task-number: QTBUG-15474 Reviewed-by: msorvig
-rw-r--r--src/gui/kernel/qcocoasharedwindowmethods_mac_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
index 9c110fd..6254061 100644
--- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
+++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
@@ -89,6 +89,8 @@ QT_END_NAMESPACE
QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)];
if (!widget)
return NO; // This should happen only for qt_root_win
+ if (QApplicationPrivate::isBlockedByModal(widget))
+ return NO;
bool isToolTip = (widget->windowType() == Qt::ToolTip);
bool isPopup = (widget->windowType() == Qt::Popup);
@@ -100,6 +102,8 @@ QT_END_NAMESPACE
QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)];
if (!widget)
return NO; // This should happen only for qt_root_win
+ if ([self isSheet])
+ return NO;
bool isToolTip = (widget->windowType() == Qt::ToolTip);
bool isPopup = (widget->windowType() == Qt::Popup);