summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2021-01-11 11:57:04 +0200
committerTor Lillqvist <tml@collabora.com>2021-01-15 16:09:37 +0100
commit36e47b136058867800b1b1afb5c1e3553674d7b6 (patch)
tree3f06a04351c14101e8fa3131a1c8002ae74f30e5
parentdf8a65e3b5b4a4e9213450407c08c74503f36a29 (diff)
Avoid assertion failure related to cursor sizes on macOS
No idea why this assertion failure started to show up now (at least when viewing a presentation slide show). Anyway, apparently the code needs to handle 256x256 cursors, too, and not just 128x128 and 32x32 ones. Apparently the assertion failure is caused by icon-themes/colibre/vcl/res/null.png. Sadly I don't really understand the code around here, but this commit gets rid of the assertion failure, and that is good enough for me for now. This problem was reported in a comment in the otherwise unrelated tdf#138122, and the assertion failure caused a hang, which is not good, reported as tdf#139535. That general problem is not fixed by this commit. Change-Id: I1390f00e03e0766d54969d9d62311a55da8e8945 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109083 Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109370 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
-rw-r--r--vcl/osx/saldata.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index 5235f657f8ca..7a9f7b42dcfe 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -248,10 +248,10 @@ NSCursor* SalData::getCursor( PointerStyle i_eStyle )
}
NSImage* theImage = load_icon_by_name(aIconName);
- assert ([theImage size].width == 128 || [theImage size].width == 32);
- if ([theImage size].width == 128)
+ assert ([theImage size].width == 256 || [theImage size].width == 128 || [theImage size].width == 32);
+ if ([theImage size].width == 256 || [theImage size].width == 128)
{
- // If we have a 128x128 image, generate scaled versions of it.
+ // If we have a 256x256 or 128x128 image, generate scaled versions of it.
// This will result in macOS picking a reasonably sized image for different screen dpi.
NSSize cursorSize = NSMakeSize(32,32);
NSImage *multiResImage = [[NSImage alloc] initWithSize:cursorSize];