Cocoa: Update the geometry whenever the window moves.

Change-Id: I3d47d62aaa0b4ccc88159ba9b6d1a3ebd42fedf5
Reviewed-on: http://codereview.qt-project.org/5255
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bjørn Erik Nilsen <bjorn.nilsen@nokia.com>
bb10
Bjørn Erik Nilsen 2011-09-20 15:04:54 +02:00 committed by Qt by Nokia
parent ba654f8034
commit 4d310b52ee
1 changed files with 10 additions and 1 deletions

View File

@ -42,6 +42,7 @@
#include "qnswindowdelegate.h"
#include "qcocoaautoreleasepool.h"
#include "qcocoaglcontext.h"
#include "qcocoahelpers.h"
#include "qnsview.h"
#include <QtCore/private/qcore_mac_p.h>
#include <qwindow.h>
@ -167,6 +168,12 @@ void QCocoaWindow::windowDidMove()
{
if (m_glContext)
m_glContext->update();
NSRect rect = [[m_nsWindow contentView]frame];
NSRect windowRect = [m_nsWindow frame];
QRect geo(windowRect.origin.x, qt_mac_flipYCoordinate(windowRect.origin.y + rect.size.height), rect.size.width, rect.size.height);
QWindowSystemInterface::handleSynchronousGeometryChange(window(), geo);
}
void QCocoaWindow::windowDidResize()
@ -175,7 +182,9 @@ void QCocoaWindow::windowDidResize()
m_glContext->update();
NSRect rect = [[m_nsWindow contentView]frame];
QRect geo(rect.origin.x,rect.origin.y,rect.size.width,rect.size.height);
NSRect windowRect = [m_nsWindow frame];
QRect geo(windowRect.origin.x, qt_mac_flipYCoordinate(windowRect.origin.y + rect.size.height), rect.size.width, rect.size.height);
QWindowSystemInterface::handleSynchronousGeometryChange(window(), geo);
}