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

Using vertical and horizontal Composite does not work under macOS anymore #1082

Closed
tkg1-de opened this issue Mar 4, 2024 · 8 comments
Closed
Labels
duplicate This issue or pull request already exists macOS happens on macOS

Comments

@tkg1-de
Copy link

tkg1-de commented Mar 4, 2024

I've written a complex program working fine for several years under macOS (Intel) and Windows as well. But after upgrading to newest Java 11 it doesn't work anymore on macOS. So I used the latest SWT 4.30 together with Java 17 (OpenJDK Runtime Environment Temurin-17.0.10+7 (build 17.0.10+7)). It doesn't work. On Windows everything is fine. On macOS the second horizontal Composite is not visible. I created a simple test class showing the problem.
SimpleSWTCompositeTest-macOS
SimpleSWTCompositeTest-Windows

This is the source code:
package main;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;

public class SimpleSWTCompositeTest {

public static void main(String[] args) {
	Display.setAppName("SimpleSWTCompositeTest");
	Display display = new Display();

	Shell shell = new Shell(display, SWT.SHELL_TRIM | SWT.CENTER);
	//shell.setSize(930, 670);

	shell.addListener(SWT.Close, new Listener() {
		public void handleEvent(Event event) {
			shell.getDisplay().dispose();
			System.exit(0);
		}
	});

	RowLayout shellLayout = new RowLayout(SWT.VERTICAL);
	shellLayout.marginTop = 7;
	shellLayout.marginBottom = 7;
	shellLayout.marginLeft = 3;
	shellLayout.marginRight = 3;
	shellLayout.spacing = 0;
	shell.setLayout(shellLayout);


	Composite headerComposite1 = new Composite(shell, SWT.NONE);
	RowLayout headerLayout1 = new RowLayout(SWT.HORIZONTAL);
	headerLayout1.marginTop = 10;
	headerLayout1.marginBottom = 10;
	headerLayout1.marginLeft = 5;
	headerLayout1.marginRight = 5;
	headerLayout1.spacing = 10;
	headerComposite1.setLayout(headerLayout1);

	Label testText11 = new Label(headerComposite1, SWT.WRAP);
	testText11.setText("Dies ist ein Test-Text! 11");
	RowData statusData11 = new RowData(203, 32);
	testText11.setLayoutData(statusData11);

	Label testText12 = new Label(headerComposite1, SWT.WRAP);
	testText12.setText("Dies ist ein Test-Text! 12");
	RowData statusData12 = new RowData(203, 32);
	testText12.setLayoutData(statusData12);


	Composite headerComposite2 = new Composite(shell, SWT.NONE);
	RowLayout headerLayout2 = new RowLayout(SWT.HORIZONTAL);
	headerLayout2.marginTop = 10;
	headerLayout2.marginBottom = 10;
	headerLayout2.marginLeft = 5;
	headerLayout2.marginRight = 5;
	headerLayout2.spacing = 10;
	headerComposite2.setLayout(headerLayout2);

	Label testText21 = new Label(headerComposite2, SWT.WRAP);
	testText21.setText("Test-Text! 21");
	RowData statusData21 = new RowData(132, 32);
	testText21.setLayoutData(statusData21);

	Label testText22 = new Label(headerComposite2, SWT.WRAP);
	testText22.setText("Test-Text! 22");
	RowData statusData22 = new RowData(132, 32);
	testText22.setLayoutData(statusData22);

	Label testText23 = new Label(headerComposite2, SWT.WRAP);
	testText23.setText("Test-Text! 23");
	RowData statusData23 = new RowData(132, 32);
	testText23.setLayoutData(statusData23);
	
	shell.setText("SimpleSWTCompositeTest");
	shell.pack();
	shell.open();

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

}

@iloveeclipse
Copy link
Member

Most likely duplicate of #1012

@Phillipus
Copy link
Contributor

Most likely duplicate of #1012

Yes, it is. I tested the snippet with Temurin-17.0.10+7 and reproduced the issue. I applied #1081 and ran the snippet again and it was OK.

@Phillipus
Copy link
Contributor

Phillipus commented Mar 4, 2024

@tkg1-de Please can you confirm macOS version and whether you use Intel or Silicon Mac.

(A workaround is to use Temurin-17.0.9)

@jukzi jukzi added duplicate This issue or pull request already exists macOS happens on macOS labels Mar 5, 2024
@jukzi
Copy link
Contributor

jukzi commented Mar 5, 2024

closing as duplicate

@jukzi jukzi closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2024
@laeubi
Copy link
Contributor

laeubi commented Mar 5, 2024

Please use this (also offered as a saved reply by github) to mark / close tickets as duplicate:

Duplicate of #<number>

@laeubi laeubi reopened this Mar 5, 2024
@laeubi
Copy link
Contributor

laeubi commented Mar 5, 2024

Duplicate of #1012

@laeubi laeubi marked this as a duplicate of #1081 Mar 5, 2024
@laeubi laeubi closed this as completed Mar 5, 2024
@laeubi laeubi marked this as a duplicate of #1012 Mar 5, 2024
@tkg1-de
Copy link
Author

tkg1-de commented Mar 5, 2024

Yes, it seems really to be a duplicate of #1012. So closing is O.K.

I use an Intel Mac (MacBook Pro 13-inch, 2019, Two Thunderbolt 3 ports). macOS 14.3.1 (latest version at this moment)

Thanks a lot!

@Phillipus
Copy link
Contributor

I use an Intel Mac...macOS 14.3.1

Thanks. I wanted to confirm this bug occurs on Intel as well as ARM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists macOS happens on macOS
Projects
None yet
Development

No branches or pull requests

5 participants