From 371cab1c2da691c654b2f86a4cabfd4f74f6b170 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 18 Mar 2010 14:40:43 +0100 Subject: Fixed qmdiarea autotest regression on Cocoa This is an addition to 4256bd2141fef53f9e69a51b966bd85f67a6cf54 - when Cocoa asks as to become first responder we should only tell Qt about it if we are embedded into Cocoa app and there is no Qt widget being focused. Reviewed-by: Prasanth --- src/gui/kernel/qcocoaview_mac.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 0bc57e0..0e378f9 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -1058,7 +1058,8 @@ static int qCocoaViewCount = 0; { // see the comment in the acceptsFirstResponder - if the window "stole" focus // let it become the responder, but don't tell Qt - if (!QApplication::focusWidget() && qwidget->focusPolicy() != Qt::NoFocus) + if (qwidget && qt_widget_private(qwidget->window())->topData()->embedded + && !QApplication::focusWidget() && qwidget->focusPolicy() != Qt::NoFocus) qwidget->setFocus(Qt::OtherFocusReason); return YES; } -- cgit v0.12