QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
}
-void QWindowSystemInterface::handleExposeEvent(QWindow *tlw, const QRegion ®ion)
+void QWindowSystemInterface::handleSynchronousExposeEvent(QWindow *tlw, const QRegion ®ion)
{
QWindowSystemInterfacePrivate::ExposeEvent *e = new QWindowSystemInterfacePrivate::ExposeEvent(tlw, region);
- QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
+ QGuiApplicationPrivate::processWindowSystemEvent(e); // send event immediately.
}
bool QWindowSystemInterface::sendWindowSystemEvents(QAbstractEventDispatcher *eventDispatcher, QEventLoop::ProcessEventsFlags flags)
static void handleMapEvent(QWindow *w);
static void handleUnmapEvent(QWindow *w);
- static void handleExposeEvent(QWindow *w, const QRegion ®ion);
+ static void handleSynchronousExposeEvent(QWindow *tlw, const QRegion ®ion);
// Drag and drop. These events are sent immediately.
static Qt::DropAction handleDrag(QWindow *w, QMimeData *dropData, const QPoint &p);
if (window()->transientParent())
setGeometry(window()->geometry());
+ // Make sure the QWindow has a frame ready before we show the NSWindow.
+ QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRect(QPoint(), geometry().size()));
+
[m_nsWindow makeKeyAndOrderFront:nil];
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
} else {
[m_nsWindow orderOut:nil];
}
panel = [[NSPanel alloc] initWithContentRect:frame
styleMask:m_windowAttributes
backing:NSBackingStoreBuffered
- defer:YES];
+ defer:NO]; // see window case below
// ### crashes
// [panel setFloatingPanel:needFloating];
// [panel setWorksWhenModal:worksWhenModal];
window = [[QNSWindow alloc] initWithContentRect:frame
styleMask:(NSResizableWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSTitledWindowMask)
backing:NSBackingStoreBuffered
- defer:YES];
+ defer:NO]; // Deferring window creation breaks OpenGL (the GL context is set up
+ // before the window is shown and needs a proper window.).
break;
}
mBuffer = buffer;
if (mSurface) {
wl_surface_attach(mSurface, buffer->buffer(),0,0);
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
+ QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRect(QPoint(), geometry().size()));
}
}
if (QWindowsContext::verboseIntegration)
qDebug() << __FUNCTION__ << this << window() << updateRect;
- QWindowSystemInterface::handleExposeEvent(window(), QRegion(updateRect));
+ QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRegion(updateRect));
clearFlag(WithinWmPaint);
m_hdc = 0;
EndPaint(hwnd, &ps);
switch (response_type) {
case XCB_EXPOSE:
- HANDLE_PLATFORM_WINDOW_EVENT(xcb_expose_event_t, window, handleExposeEvent);
+ HANDLE_PLATFORM_WINDOW_EVENT(xcb_expose_event_t, window, handleSynchronousExposeEvent);
case XCB_BUTTON_PRESS:
HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_press_event_t, event, handleButtonPressEvent);
case XCB_BUTTON_RELEASE:
void QXcbWindow::handleExposeEvent(const xcb_expose_event_t *event)
{
QRect rect(event->x, event->y, event->width, event->height);
- QWindowSystemInterface::handleExposeEvent(window(), rect);
+ QWindowSystemInterface::handleSynchronousExposeEvent(window(), rect);
}
void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *event)