Skip to content

Commit a39c321

Browse files
authored
Fix for Mac drawing bug issue 1012 part 2 (#1232)
- OS.objc_msgSend(id, OS.sel_setClipsToBounds_, true) needs to be applied in two more cases - See #1012
1 parent 2ff635c commit a39c321

File tree

1 file changed

+10
-0
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets

1 file changed

+10
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java

+10
Original file line numberDiff line numberDiff line change
@@ -2101,6 +2101,11 @@ boolean setMarkedText_selectedRange (long id, long sel, long string, long range)
21012101
void setNeedsDisplay (long id, long sel, boolean flag) {
21022102
if (flag && !isDrawing()) return;
21032103
NSView view = new NSView(id);
2104+
/*
2105+
* Since macOS 14 the clipsToBounds property of NSView has to be set to true
2106+
* See https://developer.apple.com/documentation/macos-release-notes/appkit-release-notes-for-macos-14
2107+
*/
2108+
OS.objc_msgSend(id, OS.sel_setClipsToBounds_, true);
21042109
if (flag && display.isPainting.containsObject(view)) {
21052110
NSMutableArray needsDisplay = display.needsDisplay;
21062111
if (needsDisplay == null) {
@@ -2121,6 +2126,11 @@ void setNeedsDisplayInRect (long id, long sel, long arg0) {
21212126
NSRect rect = new NSRect();
21222127
OS.memmove(rect, arg0, NSRect.sizeof);
21232128
NSView view = new NSView(id);
2129+
/*
2130+
* Since macOS 14 the clipsToBounds property of NSView has to be set to true
2131+
* See https://developer.apple.com/documentation/macos-release-notes/appkit-release-notes-for-macos-14
2132+
*/
2133+
OS.objc_msgSend(id, OS.sel_setClipsToBounds_, true);
21242134
if (display.isPainting.containsObject(view)) {
21252135
NSMutableArray needsDisplayInRect = display.needsDisplayInRect;
21262136
if (needsDisplayInRect == null) {

0 commit comments

Comments
 (0)