diff options
| author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-09-05 22:36:21 +0200 |
|---|---|---|
| committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-09-11 16:36:50 +0000 |
| commit | d8c210d7f576fc54b41ad06c061ece7cadeed648 (patch) | |
| tree | 18e9de244c23995952118604e2d8f04552f4240d /src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp | |
| parent | 017ac02ec459378074a44487f171cc909e947f4a (diff) | |
macOS: Prevent flickering when resizing window rendered to by separate thread
When a window is resized AppKit groups all updates to the view frames and
corresponding layer bounds, so that the result of the resize is visually
atomic, but this only works for the main thread.
http://openradar.appspot.com/radar?id=4990815088672768
When a separate thread renders to one of the views in the window, it may
result in the view and its layer updating its bounds visually before the
resize has been visually reflected for the window itself and its border.
To ensure visually atomic updates, we disable all screen updates for the
process during resizing. This is the same workaround used by e.g. the
NSOpenPanel class, which renders the content of the view out of process,
and by Chromium for a similar use-case:
https://chromium-review.googlesource.com/c/chromium/src/+/798774
Ideally we'd do this only for the window that is being resized, but there's
no known API to do that. The deprecated [NSWindow disableScreenUpdatesUntilFlush]
is a no-op these days, and used NSDisableScreenUpdates internally anyways).
Fixes: QTBUG-69321
Change-Id: I84de714782278f2e0b2b2e1eb245c30810cb3023
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp')
0 files changed, 0 insertions, 0 deletions
