summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorMarkku Luukkainen <markku.luukkainen@digia.com>2009-06-08 07:08:07 (GMT)
committerMarkku Luukkainen <markku.luukkainen@digia.com>2009-06-08 07:08:07 (GMT)
commit16663479c6fb57bf1e734d0dc1c1a92c7f2fb3e5 (patch)
treeab79addcad3ed7584795469333dda3b291132b23 /src/gui/kernel
parent267891cb23e0e751873f9a6cf5dd951287c0e5e5 (diff)
parent75fc8ab96ee142ade5362eeaa94ce7e47ebcb579 (diff)
downloadQt-16663479c6fb57bf1e734d0dc1c1a92c7f2fb3e5.zip
Qt-16663479c6fb57bf1e734d0dc1c1a92c7f2fb3e5.tar.gz
Qt-16663479c6fb57bf1e734d0dc1c1a92c7f2fb3e5.tar.bz2
Merge branch 'softkeys' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into softkeys_without_stack
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qapplication_x11.cpp8
-rw-r--r--src/gui/kernel/qwidget.cpp5
-rw-r--r--src/gui/kernel/qwidget_mac.mm8
3 files changed, 14 insertions, 7 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index a3c9406..12155f0 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -2955,10 +2955,10 @@ QWidget *QApplication::topLevelAt(const QPoint &p)
Window wid = widget->internalWinId();
while (ctarget && !w) {
X11->ignoreBadwindow();
- XTranslateCoordinates(X11->display,
- QX11Info::appRootWindow(screen),
- ctarget, x, y, &unused, &unused, &ctarget);
- if (X11->badwindow())
+ if (!XTranslateCoordinates(X11->display,
+ QX11Info::appRootWindow(screen),
+ ctarget, x, y, &unused, &unused, &ctarget)
+ || X11->badwindow())
break;
if (ctarget == wid) {
// Found!
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index e82fbd2..c592c57 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -5828,8 +5828,9 @@ void QWidget::setFocus(Qt::FocusReason reason)
void QWidget::clearFocus()
{
QWidget *w = this;
- while (w && w->d_func()->focus_child == this) {
- w->d_func()->focus_child = 0;
+ while (w) {
+ if (w->d_func()->focus_child == this)
+ w->d_func()->focus_child = 0;
w = w->parentWidget();
}
#ifndef QT_NO_GRAPHICSVIEW
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()) {