Q_UNUSED(priv);
Q_UNUSED(type);
- qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
QColormap::initialize();
if (const QPalette *toolTipPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::ToolTipPalette))
QPaintEvent e(toBePainted);
QCoreApplication::sendSpontaneousEvent(q, &e);
+ // Native widgets need to be marked dirty on screen so painting will be done in correct context
+ if (backingStore && !onScreen && !asRoot && (q->internalWinId() || !q->nativeParentWidget()->isWindow()))
+ backingStore->markDirtyOnScreen(toBePainted, q, offset);
+
//restore
if (paintEngine) {
#ifdef Q_WS_MAC
setWindowModified_helper();
setWinId(win->winId());
-// first check children. and create them if necessary
-// q_createNativeChildrenAndSetParent(q->windowHandle(),q);
+ // Check children and create windows for them if necessary
+ q_createNativeChildrenAndSetParent(q->windowHandle(), q);
-// qDebug() << "create_sys" << q << q->internalWinId();
+ // If widget is already shown, set window visible, too
+ if (q->isVisible())
+ win->setVisible(true);
}
void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
#ifndef QT_NO_ACCESSIBILITY
#include <QtGui/qaccessible.h>
#endif
+#include <private/qwidgetbackingstore_p.h>
QT_BEGIN_NAMESPACE
{
if (isExposed()) {
m_widget->setAttribute(Qt::WA_Mapped);
- if (!event->region().isNull())
+ if (!event->region().isNull()) {
+ // Exposed native widgets need to be marked dirty to get them repainted correctly.
+ if (m_widget->internalWinId() && !m_widget->isWindow()) {
+ if (QWidgetBackingStore *bs = m_widget->d_func()->maybeBackingStore())
+ bs->markDirty(event->region(), m_widget);
+ }
m_widget->d_func()->syncBackingStore(event->region());
+ }
} else {
m_widget->setAttribute(Qt::WA_Mapped, false);
}