summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoawindow.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 4d0458a4aa..7e22351818 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -43,7 +43,9 @@
#include "qnswindowdelegate.h"
#include "qcocoaautoreleasepool.h"
#include "qcocoaeventdispatcher.h"
+#ifndef QT_NO_OPENGL
#include "qcocoaglcontext.h"
+#endif
#include "qcocoahelpers.h"
#include "qcocoanativeinterface.h"
#include "qnsview.h"
@@ -373,7 +375,9 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
, m_windowUnderMouse(false)
, m_inConstructor(true)
, m_inSetVisible(false)
+#ifndef QT_NO_OPENGL
, m_glContext(0)
+#endif
, m_menubar(0)
, m_windowCursor(0)
, m_hasModalSession(false)
@@ -512,7 +516,7 @@ void QCocoaWindow::setCocoaGeometry(const QRect &rect)
// call this here: updateGeometry in qnsview.mm is a no-op for this case
QWindowSystemInterface::handleGeometryChange(window(), rect);
- QWindowSystemInterface::handleExposeEvent(window(), rect);
+ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), rect.size()));
} else if (m_nsWindow) {
NSRect bounds = qt_mac_flipRect(rect);
[m_nsWindow setFrame:[m_nsWindow frameRectForContentRect:bounds] display:YES animate:NO];
@@ -712,8 +716,10 @@ void QCocoaWindow::setVisible(bool visible)
[m_contentView setHidden:NO];
} else {
// qDebug() << "close" << this;
+#ifndef QT_NO_OPENGL
if (m_glContext)
m_glContext->windowWasHidden();
+#endif
QCocoaEventDispatcher *cocoaEventDispatcher = qobject_cast<QCocoaEventDispatcher *>(QGuiApplication::instance()->eventDispatcher());
QCocoaEventDispatcherPrivate *cocoaEventDispatcherPrivate = 0;
if (cocoaEventDispatcher)
@@ -1224,6 +1230,7 @@ bool QCocoaWindow::windowIsPopupType(Qt::WindowType type) const
return ((type & Qt::Popup) == Qt::Popup);
}
+#ifndef QT_NO_OPENGL
void QCocoaWindow::setCurrentContext(QCocoaGLContext *context)
{
m_glContext = context;
@@ -1233,6 +1240,7 @@ QCocoaGLContext *QCocoaWindow::currentContext() const
{
return m_glContext;
}
+#endif
void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow)
{
@@ -1741,7 +1749,7 @@ void QCocoaWindow::exposeWindow()
m_isExposed = true;
m_exposedGeometry = geometry();
m_exposedDevicePixelRatio = devicePixelRatio();
- QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry()));
+ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), m_exposedGeometry.size()));
}
}
@@ -1772,7 +1780,7 @@ void QCocoaWindow::updateExposedGeometry()
m_isExposed = true;
m_exposedGeometry = geometry();
m_exposedDevicePixelRatio = devicePixelRatio();
- QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry()));
+ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), m_exposedGeometry.size()));
}
QWindow *QCocoaWindow::childWindowAt(QPoint windowPoint)