Skip to content

Commit 70a8e32

Browse files
committed
FIX: Disable cursorRect updates from within macosx backend
We want to keep control of the cursor updates from within MPL, so don't allow the App to push a new cursor update when the window gets updated. This would happen when a TextView would get resized and update the frame.
1 parent 06ea324 commit 70a8e32

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/_macosx.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,10 @@ static CGFloat _get_device_scale(CGContextRef cr)
565565
Window* window = self->window;
566566
[window setDelegate: view];
567567
[window makeFirstResponder: view];
568+
// Disable cursorRects so that the cursor doesn't get updated by events
569+
// in NSApp (like resizing TextViews), we want to handle the cursor
570+
// changes from within MPL with set_cursor() ourselves
571+
[window disableCursorRects];
568572
[[window contentView] addSubview: view];
569573
[view updateDevicePixelRatio: [window backingScaleFactor]];
570574

@@ -956,9 +960,6 @@ -(void)save_figure:(id)sender { gil_call_method(toolbar, "save_figure"); }
956960
[messagebox setFrame: rect];
957961
// We want to control the vertical position of
958962
// the rect by the content size to center it vertically
959-
// TODO: This seems to disable the cursor updates with newlines that
960-
// are included in the image hover text. It is only when trying
961-
// to set the frame height based on the contentRect's size.
962963
[messagebox.layoutManager ensureLayoutForTextContainer: messagebox.textContainer];
963964
NSRect contentRect = [messagebox.layoutManager usedRectForTextContainer: messagebox.textContainer];
964965
rect.origin.y = 0.5 * (self->height - contentRect.size.height);

0 commit comments

Comments
 (0)