-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for Mac drawing bug #1081
Fix for Mac drawing bug #1081
Conversation
Phillipus
commented
Mar 4, 2024
- Add a new selector setClipsToBounds
- Set this selector to true in Widget#drawRect
- See MacOS 14.3 M2: RCP application blank screen with Temurin 17.0.10 #1012
Pre-requisites to test this PR:
|
b2b6a62
to
0b11e07
Compare
Added a commit that calls |
We don't add any code directly to NSView.java (and all NS*.java files) as they are auto-generated by the MacGenerator tool. Every time we run the MacGenerator, it will generate the files again and our changes will be lost. |
I found that the fix only works in the If I don't really know what is the best approach here. |
Yes,
Let's go with the previous approach of setting the property in drawRect for now, until we find a way to initialize the property. |
73c08d6
to
d45a4e4
Compare
Pushed new commit that doesn't add anything to |
Changes look good to me, but I've not tested it myself. Since there are no native changes, code should compile fine with older SDK as well. The release notes mention that symbol is available till 10.9, hence no version check is required to guard the call for older SDK versions. @Phillipus please correct me if I missed something. |
@lshanmug I think your summary is correct. Thanks for your feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me. With all the information given by @lshanmug, it seems to be sound to change the clipping property within the drawRect()
method. It won't affect NSView
in the same way as setting the property within NSView
's constructor (as it is instantiated at far more places than in the drawRect()
method), but since the value is only relevant on drawing, it seems to be sufficient to set it there. And doing it only where necessary also reduces the number of OS calls.
From a user's point of view, I have tested the change with an SDK product started from within an Eclipse IDE and everything worked for me as expected, no issues so far. Using the same run configuration without this fix shows the addressed issue.
MacOS: Sonoma 14.1.1
Chip: Apple M2 Pro
JDK: Temurin 17.0.10
In case there are no further concerns, I propose to merge this soon to find potential regressions or further issues as soon as possible.
Thanks for the feedback @HeikoKlare I've also tested it on non-affected macOS (13) and non affected Java and it's OK. On macOS 13 and earlier the selector call is basically a NOP, so does nothing. As of today, this problem will mainly affect Eclipse developers who are on macOS 14 and who target the latest versions of Temurin Java. As explained elsewhere, this is because the Temurin But it also affects SWT-based apps such as this one. As of today, it won't affect Eclipse on Mac itself because the So it would be good to get this fix in for the next release of Eclipse, and it will also benefit apps that use SWT directly. |
Could someone merge this so we can get feedback? |
- Add a new selector setClipsToBounds - Set this selector to true in Widget#drawRect - See eclipse-platform#1012
I rebased it to ensure that we aren't missing a version increment or something like that. I'll merge when it's done. Feel free to ping with a friendly reminding if I don't do this after the build completed. 😀 |
@merks Thanks for the rebase and merge, I appreciate it. :-) |
What goes around, comes around. 👼 |