summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2021-01-11 11:57:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-12 18:06:37 +0100
commitaa54b2c7b6747da4710701131a8a5b1fb43b1453 (patch)
tree771e43c8a03a7cec45c13d5236d54dbbca9579c7
parentec542cd17d376b0cfabc0a5cf82edd1fd3012350 (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/+/109164 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-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];