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
parent
ba654f8034
commit
4d310b52ee
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue