summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_mac.mm
diff options
context:
space:
mode:
authorMarkku Luukkainen <markku.luukkainen@digia.com>2009-06-08 07:06:17 (GMT)
committerMarkku Luukkainen <markku.luukkainen@digia.com>2009-06-08 07:06:17 (GMT)
commit75fc8ab96ee142ade5362eeaa94ce7e47ebcb579 (patch)
tree36a8c57866582eeff875615c0aeb1a0f148ba1c3 /src/gui/kernel/qwidget_mac.mm
parent93ea4a9cd6336de6e2a63b1ca075a7fdb835cfa7 (diff)
parent23ae8b6badfd688f962590268a6147771d27266c (diff)
downloadQt-75fc8ab96ee142ade5362eeaa94ce7e47ebcb579.zip
Qt-75fc8ab96ee142ade5362eeaa94ce7e47ebcb579.tar.gz
Qt-75fc8ab96ee142ade5362eeaa94ce7e47ebcb579.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into softkeys
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r--src/gui/kernel/qwidget_mac.mm8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index f863428..b2256cd 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3600,11 +3600,15 @@ void QWidgetPrivate::raise_sys()
}
} else {
// Cocoa doesn't really have an idea of Z-ordering, but you can
- // fake it by changing the order of it.
+ // fake it by changing the order of it. But beware, removing an
+ // NSView will also remove it as the first responder. So we re-set
+ // the first responder just in case:
NSView *view = qt_mac_nativeview_for(q);
NSView *parentView = [view superview];
+ NSResponder *firstResponder = [[view window] firstResponder];
[view removeFromSuperview];
[parentView addSubview:view];
+ [[view window] makeFirstResponder:firstResponder];
}
#else
if(q->isWindow()) {
@@ -3642,6 +3646,7 @@ void QWidgetPrivate::lower_sys()
NSArray *tmpViews = [parentView subviews];
NSMutableArray *subviews = [[NSMutableArray alloc] initWithCapacity:[tmpViews count]];
[subviews addObjectsFromArray:tmpViews];
+ NSResponder *firstResponder = [[myview window] firstResponder];
// Implicit assumption that myViewIndex is included in subviews, that's why I'm not checking
// myViewIndex.
NSUInteger index = 0;
@@ -3661,6 +3666,7 @@ void QWidgetPrivate::lower_sys()
for (NSView *subview in subviews)
[parentView addSubview:subview];
[subviews release];
+ [[myview window] makeFirstResponder:firstResponder];
}
#else
if(q->isWindow()) {