summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-02-09 15:45:29 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-02-09 15:45:29 (GMT)
commita49a2ae399643afd30dd5d2df90ecb6d6325121a (patch)
tree5ac7bbece7c7ff90f9796430e4eaaff7728dfe29 /src/gui
parentdadfdfaa320aa5951d8512428d59e762b0da79f3 (diff)
parent392123ef5432643d1047d1e1dd71512ec39d382d (diff)
downloadQt-a49a2ae399643afd30dd5d2df90ecb6d6325121a.zip
Qt-a49a2ae399643afd30dd5d2df90ecb6d6325121a.tar.gz
Qt-a49a2ae399643afd30dd5d2df90ecb6d6325121a.tar.bz2
Merge branch '4.5' of scm.dev.nokia.troll.no:qt/qt into 4.6
Conflicts: src/gui/kernel/qapplication_win.cpp src/gui/kernel/qwidget.cpp src/gui/kernel/qwidget_p.h
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qapplication_win.cpp28
-rw-r--r--src/gui/kernel/qwidget.cpp2
-rw-r--r--src/gui/kernel/qwidget_p.h2
3 files changed, 21 insertions, 11 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 3355272..0a4869b 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -928,7 +928,11 @@ const QString qt_reg_winclass(QWidget *w) // register window class
uint style;
bool icon;
QString cname;
- if (flags & Qt::MSWindowsOwnDC) {
+ if (qt_widget_private(w)->isGLWidget) {
+ cname = QLatin1String("QGLWidget");
+ style = CS_DBLCLKS;
+ icon = true;
+ } else if (flags & Qt::MSWindowsOwnDC) {
cname = QLatin1String("QWidgetOwnDC");
style = CS_DBLCLKS;
#ifndef Q_WS_WINCE
@@ -1021,7 +1025,7 @@ const QString qt_reg_winclass(QWidget *w) // register window class
}
wc.hCursor = 0;
#ifndef Q_WS_WINCE
- wc.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_WINDOW);
+ wc.hbrBackground = qt_widget_private(w)->isGLWidget ? 0 : (HBRUSH)GetSysColorBrush(COLOR_WINDOW);
#else
wc.hbrBackground = 0;
#endif
@@ -3616,13 +3620,19 @@ bool QETWidget::translatePaintEvent(const MSG &msg)
return true;
setAttribute(Qt::WA_PendingUpdate, false);
- const QRegion dirtyInBackingStore(qt_dirtyRegion(this));
- // Make sure the invalidated region contains the region we're about to repaint.
- // BeginPaint will set the clip to the invalidated region and it is impossible
- // to enlarge it afterwards (only shrink it). Using GetDCEx is not suffient
- // as it may return an invalid context (especially on Windows Vista).
- if (!dirtyInBackingStore.isEmpty())
- InvalidateRgn(internalWinId(), dirtyInBackingStore.handle(), false);
+
+ if (d_func()->isGLWidget) {
+ if (d_func()->usesDoubleBufferedGLContext)
+ InvalidateRect(internalWinId(), 0, false);
+ } else {
+ const QRegion dirtyInBackingStore(qt_dirtyRegion(this));
+ // Make sure the invalidated region contains the region we're about to repaint.
+ // BeginPaint will set the clip to the invalidated region and it is impossible
+ // to enlarge it afterwards (only shrink it). Using GetDCEx is not suffient
+ // as it may return an invalid context (especially on Windows Vista).
+ if (!dirtyInBackingStore.isEmpty())
+ InvalidateRgn(internalWinId(), dirtyInBackingStore.handle(), false);
+ }
PAINTSTRUCT ps;
d_func()->hd = BeginPaint(internalWinId(), &ps);
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index c072d9d..2a19d23 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -192,6 +192,7 @@ QWidgetPrivate::QWidgetPrivate(int version)
, inDirtyList(0)
, isScrolled(0)
, isMoved(0)
+ , isGLWidget(0)
, usesDoubleBufferedGLContext(0)
#if defined(Q_WS_X11)
, picture(0)
@@ -200,7 +201,6 @@ QWidgetPrivate::QWidgetPrivate(int version)
, nativeGesturePanEnabled(0)
#elif defined(Q_WS_MAC)
, needWindowChange(0)
- , isGLWidget(0)
, window_event(0)
, qd_hd(0)
#endif
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index b1eb3c3..1e3e6be 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -682,6 +682,7 @@ public:
uint inDirtyList : 1;
uint isScrolled : 1;
uint isMoved : 1;
+ uint isGLWidget : 1;
uint usesDoubleBufferedGLContext : 1;
// *************************** Platform specific ************************************
@@ -713,7 +714,6 @@ public:
#elif defined(Q_WS_MAC) // <--------------------------------------------------------- MAC
// This is new stuff
uint needWindowChange : 1;
- uint isGLWidget : 1;
// Each wiget keeps a list of all its child and grandchild OpenGL widgets.
// This list is used to update the gl context whenever a parent and a granparent