Cocoa: fix frameStrutMouseEvents
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>
Thu, 18 Oct 2012 11:25:56 +0000 (13:25 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 18 Oct 2012 19:50:27 +0000 (21:50 +0200)
commit0221d769c76e50d8b331c2cdf527110b62cb3e66
treef0b59dfaedfaf67078714bd4441f14136aff907b
parentf45afd71551a6cd1553952ea003e9356651809b5
Cocoa: fix frameStrutMouseEvents

It turns out that the calculation of mouse pos over the frame
strut (title bar) was wrong. When outside the content view, the
nsevent coordinates are negative, so to get this correct, we
need to calculate the height of the window above the content view
and use this information to get the mouse pos in positive
coordinates with origin window top left.

This bug was especially apperent with QDockWidget, as it became
almost impossible to dock a window under such circumstances.

Change-Id: I2faf6aab5e2aa0b4e217ea087ceec8c1b1e978bb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
src/plugins/platforms/cocoa/qnsview.mm