From aa54b2c7b6747da4710701131a8a5b1fb43b1453 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 11 Jan 2021 11:57:04 +0200 Subject: 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 Reviewed-by: Tor Lillqvist Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109164 Reviewed-by: Noel Grandin --- vcl/osx/saldata.cxx | 6 +++--- 1 file 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]; -- cgit