Skip to content
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

[Mac] Proper fix for Mac blank UI - add setClipsToBounds in NSView constructor #1235

Open
Phillipus opened this issue May 16, 2024 · 0 comments
Labels
macOS happens on macOS

Comments

@Phillipus
Copy link
Contributor

Phillipus commented May 16, 2024

Background

The problem is blank areas appearing in the UI on Mac 14 (Sonoma). See #1012

This affects macOS 14 (Sonoma) and whether the target launcher binary is linked to Mac SDK 14. The target launcher binary can be java in the case of running a child Eclipse or RCP app instance, or eclipse when running Eclipse itself.

As of now the eclipse launcher binary is linked to Mac SDK 13 so this issue won't manifest when running Eclipse (or an RCP app) itself. However, it may be that one day the eclipse binary will be linked to Mac SDK 14. See eclipse-equinox/equinox#495

Temurin JDK 17.0.10, 21.0.2 and later versions are linked to Mac SDK 14 so the issue will be seen when launching a child Eclipse instance that targets one of these JDKs, because the binary launcher in this case is java.

Current remedy

The solution is to set setClipsToBounds to true for an NSView. See https://developer.apple.com/documentation/macos-release-notes/appkit-release-notes-for-macos-14#NSView

This has been done in three places in two PRs in the Widget component. See #1081 and #1232

Long-term remedy

Those three instances of setClipsToBounds may not be enough and ideally we should set it just once in the constructor of NSView like this:

public NSView(long id) {
    super(id);
    OS.objc_msgSend(id, OS.sel_setClipsToBounds_, true);
}

However, this is not as simple as inserting one line of code as explained by @lshanmug - #1081 (comment) and I'll quote it here:

setClipstoBounds can't be added directly to NSView.java, it has to ideally be added through the MacGenerator tool and generated. But since it's a new symbol, it can't be added through the tool as well without updating the bridgesupport files. (for more info pls see https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/bundles/org.eclipse.swt/Readme.macOS.md)

So I've opened this issue to track the possibility of doing this. Disclaimer - I don't know how to do this, so help required!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS happens on macOS
Projects
None yet
Development

No branches or pull requests

2 participants