summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qaction.cpp2
-rw-r--r--src/gui/kernel/qapplication.cpp6
-rw-r--r--src/gui/kernel/qapplication_win.cpp6
-rw-r--r--src/gui/kernel/qapplication_x11.cpp8
-rw-r--r--src/gui/kernel/qwidget.cpp11
-rw-r--r--src/gui/kernel/qwidget_mac.mm5
-rw-r--r--src/gui/kernel/qwidget_x11.cpp3
7 files changed, 31 insertions, 10 deletions
diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp
index b2afbd0..051b6a6 100644
--- a/src/gui/kernel/qaction.cpp
+++ b/src/gui/kernel/qaction.cpp
@@ -76,7 +76,7 @@ static QString qt_strippedText(QString s)
s.remove(i-1,1);
}
return s.trimmed();
-};
+}
QActionPrivate::QActionPrivate() : group(0), enabled(1), forceDisabled(0),
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 4855544..3c9d2a8 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -420,7 +420,7 @@ QPalette *QApplicationPrivate::set_pal = 0; // default palette set by pro
QGraphicsSystem *QApplicationPrivate::graphics_system = 0; // default graphics system
QString QApplicationPrivate::graphics_system_name; // graphics system id - for delayed initialization
-Q_GLOBAL_STATIC(QMutex, applicationFontMutex);
+Q_GLOBAL_STATIC(QMutex, applicationFontMutex)
QFont *QApplicationPrivate::app_font = 0; // default application font
QFont *QApplicationPrivate::sys_font = 0; // default system font
QFont *QApplicationPrivate::set_font = 0; // default font set by programmer
@@ -853,9 +853,11 @@ void QApplicationPrivate::initialize()
// trigger registering of QVariant's GUI types
extern int qRegisterGuiVariant();
qRegisterGuiVariant();
+#ifndef QT_NO_STATEMACHINE
// trigger registering of QStateMachine's GUI types
extern int qRegisterGuiStateMachine();
qRegisterGuiStateMachine();
+#endif
is_app_running = true; // no longer starting up
@@ -1081,9 +1083,11 @@ QApplication::~QApplication()
QApplicationPrivate::fade_tooltip = false;
QApplicationPrivate::widgetCount = false;
+#ifndef QT_NO_STATEMACHINE
// trigger unregistering of QStateMachine's GUI types
extern int qUnregisterGuiStateMachine();
qUnregisterGuiStateMachine();
+#endif
// trigger unregistering of QVariant's GUI types
extern int qUnregisterGuiVariant();
qUnregisterGuiVariant();
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index d3bb6c2..1261a20 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -2098,9 +2098,13 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
// WM_ACTIVATEAPP handles the "true" false case, as this is only when the application
// loses focus. Doing it here would result in the widget getting focus to not know
// where it got it from; it would simply get a 0 value as the old focus widget.
+#ifndef Q_WS_WINCE_WM
if (!(widget->windowState() & Qt::WindowMinimized)) {
// Ignore the activate message send by WindowsXP to a minimized window
-#ifdef Q_WS_WINCE_WM
+#else
+ {
+ if (widget->windowState() & Qt::WindowMinimized)
+ widget->dataPtr()->window_state &= ~Qt::WindowMinimized;
if (widget->windowState() & Qt::WindowFullScreen)
qt_wince_hide_taskbar(widget->winId());
#endif
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index e16e416..3a03741 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -2954,10 +2954,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 59bb600..fb2e219 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -5677,10 +5677,15 @@ void QWidget::setFocus(Qt::FocusReason reason)
w = w->isWindow() ? 0 : w->parentWidget();
}
} else {
- while (w) {
+ while (w && w->isVisible()) {
w->d_func()->focus_child = f;
w = w->isWindow() ? 0 : w->parentWidget();
}
+ // a special case, if there is an invisible parent, notify him
+ // about the focus_child widget, so that if it becomes
+ // visible, the focus widget will be respected.
+ if (w)
+ w->d_func()->focus_child = f;
}
#ifndef QT_NO_GRAPHICSVIEW
@@ -6732,6 +6737,10 @@ void QWidgetPrivate::show_helper()
if (QApplicationPrivate::hidden_focus_widget == q) {
QApplicationPrivate::hidden_focus_widget = 0;
q->setFocus(Qt::OtherFocusReason);
+ } else if (focus_child) {
+ // if we are shown and there is an explicit focus child widget
+ // set, respect it by giving him focus.
+ focus_child->setFocus(Qt::OtherFocusReason);
}
// Process events when showing a Qt::SplashScreen widget before the event loop
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 8243f32..f389bfd 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -1304,8 +1304,11 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event,
if(part == kControlFocusNoPart){
if (widget->hasFocus())
QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason);
- } else
+ } else if (widget->focusPolicy() != Qt::NoFocus) {
widget->setFocus();
+ } else {
+ handled_event = false;
+ }
}
if(!HIObjectIsOfClass((HIObjectRef)hiview, kObjectQWidget))
CallNextEventHandler(er, event);
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index adb48a8..4e34045 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -1569,7 +1569,6 @@ QWidget *QWidget::keyboardGrabber()
void QWidget::activateWindow()
{
- Q_D(QWidget);
QWidget *tlw = window();
if (tlw->isVisible() && !tlw->d_func()->topData()->embedded && !X11->deferred_map.contains(tlw)) {
if (X11->userTime == 0)
@@ -2547,6 +2546,8 @@ void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r)
QRect sr = valid_rect ? r : clipRect();
if (just_update)
q->update();
+ else if (!valid_rect)
+ dirty.translate(dx, dy);
int x1, y1, x2, y2, w = sr.width(), h = sr.height();
if (dx > 0) {