src/gui/kernel/qwidget_win.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
child 37 758a864f9613
--- a/src/gui/kernel/qwidget_win.cpp	Tue Jul 06 15:10:48 2010 +0300
+++ b/src/gui/kernel/qwidget_win.cpp	Wed Aug 18 10:37:55 2010 +0300
@@ -70,6 +70,7 @@
 #include "qguifunctions_wince.h"
 QT_USE_NAMESPACE
 extern void qt_wince_maximize(QWidget *widget);                          //defined in qguifunctions_wince.cpp
+extern void qt_wince_unmaximize(QWidget *widget);                        //defined in qguifunctions_wince.cpp
 extern void qt_wince_minimize(HWND hwnd);                                //defined in qguifunctions_wince.cpp
 extern void qt_wince_full_screen(HWND hwnd, bool fullScreen, UINT swpf); //defined in qguifunctions_wince.cpp
 extern bool qt_wince_is_mobile();                                        //defined in qguifunctions_wince.cpp
@@ -544,6 +545,7 @@
 void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
 {
     Q_D(QWidget);
+    d->aboutToDestroy();
     if (!isWindow() && parentWidget())
         parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry()));
     d->deactivateWidgetCleanup();
@@ -1166,7 +1168,7 @@
         // This is to resolve the problem where popups are opened from the
         // system tray and not being implicitly activated
         if (q->windowType() == Qt::Popup &&
-            (!q->parentWidget() || !q->parentWidget()->isActiveWindow()))
+            !q->parentWidget() && !qApp->activeWindow()) 
             q->activateWindow();
     }
 
@@ -2075,7 +2077,7 @@
 
 void QWidgetPrivate::winSetupGestures()
 {
-#if !defined(QT_NO_NATIVE_GESTURES)
+#if !defined(QT_NO_GESTURES) && !defined(QT_NO_NATIVE_GESTURES)
     Q_Q(QWidget);
     if (!q || !q->isVisible() || !nativeGesturePanEnabled)
         return;