diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-02-23 15:27:51 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-02-23 20:52:04 +0100 |
commit | 715b7b6f346fdd9c856db268dcd66334b58c273c (patch) | |
tree | 9481339a3db5393cfab94fcd55ea31ea2306ae56 /vcl/inc | |
parent | 6d67347311923dbe3975cfa197649f5856c00723 (diff) |
tdf#103571: Avoid spurious heavy SalEvent::DisplayChanged callbacks
It seems that on some Macs that the
NSApplicationDidChangeScreenParametersNotification is sent for unknown
reasons quite often. I can reproduce the problem by changing the Dock
size in System Preferences while LibreOffice is running, but others
seem to get it without resorting to such trickery.
The code used to invoke the SalEvent::DisplayChanged callback in all
cases, which can be extremely heavy, as it involves re-measuring text
layouts all over the place in all open document windows.
Avoid that if the geometry in fact has not changed.
Sure, there still is the problem that LibreOffice can become
unresponsive for several seconds when the display geometry *does*
change, like when you attach or detach a display.
Change-Id: I659881e5e392bd599f6be190835e32a77d9f4725
Reviewed-on: https://gerrit.libreoffice.org/50249
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/osx/salframe.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h index 0d93e9e9b2ff..c2b53e270648 100644 --- a/vcl/inc/osx/salframe.h +++ b/vcl/inc/osx/salframe.h @@ -82,6 +82,7 @@ public: PointerStyle mePointerStyle; // currently active pointer style NSTrackingRectTag mnTrackingRectTag; // used to get enter/leave messages + NSRect maTrackingRect; CGMutablePathRef mrClippingPath; // used for "shaping" std::vector< CGRect > maClippingRects; @@ -95,6 +96,11 @@ public: // To prevent display sleep during presentation IOPMAssertionID mnAssertionID; + NSRect maFrameRect; + NSRect maContentRect; + + bool mbGeometryDidChange; + public: /** Constructor |