summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguiapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r--src/gui/kernel/qguiapplication.cpp41
1 files changed, 15 insertions, 26 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 5a95ebe848..57238f362f 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -143,7 +143,6 @@ QFont *QGuiApplicationPrivate::app_font = 0;
bool QGuiApplicationPrivate::obey_desktop_settings = true;
extern void qRegisterGuiVariant();
-extern void qUnregisterGuiVariant();
extern void qInitDrawhelperAsm();
extern void qInitImageConversions();
@@ -358,8 +357,6 @@ QGuiApplication::~QGuiApplication()
clearPalette();
- qUnregisterGuiVariant();
-
#ifndef QT_NO_CURSOR
d->cursor_list.clear();
#endif
@@ -977,12 +974,6 @@ void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePriv
QGuiApplicationPrivate::processThemeChanged(
static_cast<QWindowSystemInterfacePrivate::ThemeChangeEvent *>(e));
break;
- case QWindowSystemInterfacePrivate::Map:
- QGuiApplicationPrivate::processMapEvent(static_cast<QWindowSystemInterfacePrivate::MapEvent *>(e));
- break;
- case QWindowSystemInterfacePrivate::Unmap:
- QGuiApplicationPrivate::processUnmapEvent(static_cast<QWindowSystemInterfacePrivate::UnmapEvent *>(e));
- break;
case QWindowSystemInterfacePrivate::Expose:
QGuiApplicationPrivate::processExposeEvent(static_cast<QWindowSystemInterfacePrivate::ExposeEvent *>(e));
break;
@@ -1606,30 +1597,28 @@ void QGuiApplicationPrivate::reportLogicalDotsPerInchChange(QWindowSystemInterfa
emit s->logicalDotsPerInchChanged(s->logicalDotsPerInch());
}
-void QGuiApplicationPrivate::processMapEvent(QWindowSystemInterfacePrivate::MapEvent *e)
+void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e)
{
- if (!e->mapped)
+ if (!e->exposed)
return;
- QEvent event(QEvent::Map);
- QCoreApplication::sendSpontaneousEvent(e->mapped.data(), &event);
-}
+ QWindow *window = e->exposed.data();
+ QWindowPrivate *p = qt_window_private(window);
-void QGuiApplicationPrivate::processUnmapEvent(QWindowSystemInterfacePrivate::UnmapEvent *e)
-{
- if (!e->unmapped)
- return;
+ if (!p->receivedExpose) {
+ if (p->resizeEventPending) {
+ // as a convenience for plugins, send a resize event before the first expose event if they haven't done so
+ QSize size = p->geometry.size();
+ QResizeEvent e(size, size);
+ QGuiApplication::sendSpontaneousEvent(window, &e);
- QEvent event(QEvent::Unmap);
- QCoreApplication::sendSpontaneousEvent(e->unmapped.data(), &event);
-}
+ p->resizeEventPending = false;
+ }
-void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e)
-{
- if (!e->exposed)
- return;
+ p->receivedExpose = true;
+ }
- QWindow *window = e->exposed.data();
+ p->exposed = e->isExposed;
QExposeEvent exposeEvent(e->region);
QCoreApplication::sendSpontaneousEvent(window, &exposeEvent);