summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2021-01-11 11:57:04 +0200
committerTor Lillqvist <tml@collabora.com>2021-01-11 14:21:25 +0100
commit27ed1e5232333f630aea05ac6c7d88bac3cc03aa (patch)
tree6dd8c491fdf453238268d416901dbb2cd38dedce /vcl
parentb48fb6f72358afb10ddb0fe816d6b0e4e6584d89 (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>
Diffstat (limited to 'vcl')
-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];