https://bugs.documentfoundation.org/show_bug.cgi?id=155092

--- Comment #11 from Patrick Luby <[email protected]> ---
(In reply to libreoffice from comment #8)
> I am a macOS developer but I have never looked at the LibreOffice source.
> That said, if this were a simple Mac application I would look at whether it
> was still using the old 'trackingRect' methods to control the cursor state.
> These are now deprecated, were always very difficult to get right, and seem
> to be getting very fragile on modern Macs possibly because the event queues
> get flooded. The recommended replacement is 'trackingAreas', which I have
> found to be much easier to implement and generally better behaved.

Even though I cannot reproduce this bug on macOS Sonoma, I did some debugging
and LibreOffice is removing and adding tracking rectangles during live
resizing. Maybe that is a potential cause of this bug?

I saw that if I switched to the newer "trackingArea" NSView selectors, I can
move the tracking area updating by overriding -[NSView updateTrackingAreas]. My
wild theory is that in newer versions of macOS, updating the tracking area
during a live resize is unsafe.

So, just for fun I wrote the following debug patch that overrides -[NSView
updateTrackingAreas]. What is interesting is that 1) it is getting called even
though LibreOffice is using the older "trackingRect" selectors, and 2) it does
*not* get called during live resizing. Maybe I'll just move to the newer
"trackingArea" selectors and see if it has any effect:

diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index f9eca27e305c..4b334fca1fb4 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -262,6 +262,8 @@ enum class SalEvent;
 -(NSArray *)accessibilityChildren;
 -(NSArray <id<NSAccessibilityElement>>
*)accessibilityChildrenInNavigationOrder;

+// NSTrackingArea overrides
+-(void)updateTrackingAreas;
 @end

 @interface SalFrameViewA11yWrapper : AquaA11yWrapper
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 27c9e773ec4c..2c61416b9f03 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -2512,6 +2512,12 @@ -(NSArray *)accessibilityChildren
     return [self accessibilityChildren];
 }

+-(void)updateTrackingAreas
+{
+    [super updateTrackingAreas];
+    fprintf(stderr, "Tracking areas: %lu\n", [self.trackingAreas count]);
+}
+
 @end

 @implementation SalFrameViewA11yWrapper

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to