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

[macOS 14] Scale control not rendered if style SWT.VERTICAL when alongside another control #1107

Open
Phillipus opened this issue Mar 13, 2024 · 0 comments
Labels
macOS happens on macOS

Comments

@Phillipus
Copy link
Contributor

Phillipus commented Mar 13, 2024

macOS 14.4 Sonoma (works OK on macOS 13 Ventura)
Latest SWT as of today's date

A Scale control is invisible if style is SWT.VERTICAL and is set alongside another control.

  • Run the following Snippet to see this.
  • Then change the boolean showScaleFirst variable to false and run it again to see how the control should look when rendered correctly on the right.
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Scale;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

public class ScaleControlNotShowingMacOS14 {
    
    public static void main(String[] args) {
        final Display display = new Display();

        final Shell shell = new Shell(display);
        shell.setLayout(new GridLayout(2, false));
        shell.setText("SWT Test");
        shell.setSize(450, 300);
        
        // Change this to true to show the Scale control first,
        // or false to show it after the Text control
        boolean showScaleFirst = true;
        
        if(showScaleFirst) {
            new Scale(shell, SWT.VERTICAL);
        }

        Text text = new Text(shell, SWT.MULTI);
        text.setLayoutData(new GridData(GridData.FILL_BOTH));
        
        if(!showScaleFirst) {
            new Scale(shell, SWT.VERTICAL);
        }
        
        shell.open();

        while(!shell.isDisposed()) {
            if(!display.readAndDispatch()) {
                display.sleep();
            }
        }

        display.dispose();
    }
}

Scale control on the left (invisible):

Screenshot 2024-03-13 at 11 48 38

Scale control on the right (visible):

Screenshot 2024-03-13 at 11 49 14

So far, I have no idea why this should be the case. If the Text control is replaced with a Composite or Label the Scale control renders correctly.

I've tried different experiments but no luck so far. I've a feeling it relates to some internal SDK change that Apple made in macOS 14.

@elsazac elsazac added the macOS happens on macOS label Jun 6, 2024
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