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

Shell.setSize not doen under Ubuntu 18.10 #1996

Open
vogella opened this issue Jan 29, 2019 · 2 comments
Open

Shell.setSize not doen under Ubuntu 18.10 #1996

vogella opened this issue Jan 29, 2019 · 2 comments
Milestone

Comments

@vogella
Copy link

vogella commented Jan 29, 2019

If I run the following test under Ubuntu 18.10 the Shell.setSize does not result in an update Workbench window, only the cursor is flickering.

@odockal suggested on the Mattermost channel to open an issue for this. https://mattermost.eclipse.org/eclipse/channels/reddeer

package org.reddeer.test;

import org.eclipse.reddeer.eclipse.jdt.ui.wizards.JavaProjectWizard;
import org.eclipse.reddeer.eclipse.jdt.ui.wizards.NewClassCreationWizard;
import org.eclipse.reddeer.eclipse.jdt.ui.wizards.NewClassWizardPage;
import org.eclipse.reddeer.eclipse.jdt.ui.wizards.NewJavaProjectWizardPageOne;
import org.eclipse.reddeer.eclipse.ui.perspectives.JavaPerspective;
import org.eclipse.reddeer.eclipse.ui.views.markers.ProblemsView;
import org.eclipse.reddeer.junit.runner.RedDeerSuite;
import org.eclipse.reddeer.requirements.cleanworkspace.CleanWorkspaceRequirement.CleanWorkspace;
import org.eclipse.reddeer.requirements.openperspective.OpenPerspectiveRequirement.OpenPerspective;
import org.eclipse.reddeer.swt.api.StyledText;
import org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText;
import org.eclipse.reddeer.workbench.impl.editor.DefaultEditor;
import org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell;
import org.eclipse.reddeer.workbench.impl.view.WorkbenchView;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
 */
@RunWith(RedDeerSuite.class)
@CleanWorkspace  
@OpenPerspective(JavaPerspective.class) 

public class RedDeerTest {

	private WorkbenchView projectExplorer;
	private WorkbenchView packageExplorer;

	@Test
	public void testing() {

		createJavaProject();
		for (int i = 0; i < 1; i++) {
			createJavaClass("testing" + i, "");
		}
		
		ProblemsView problemsView = new ProblemsView ();
		problemsView .open ();
		new WorkbenchView("Progress").open();
		new WorkbenchView("JUnit").open();
		new WorkbenchView("Package Explorer").open();
		
		
		WorkbenchShell workbenchShell = new WorkbenchShell();
		long start = System.currentTimeMillis();
		for (int i = 0; i < 100; i++) {
			int wert = i;
			workbenchShell.restore();
			Shell shell = workbenchShell.getSWTWidget();
			Display.getDefault().syncExec(new Runnable() {
				@Override
				public void run() {
					shell.setSize(wert, wert);
				}
			});
			
			workbenchShell.maximize();
		}
		long stop = System.currentTimeMillis();
		System.out.println("Duration: " + (stop - start));

	}
	
	private static void createJavaProject() {
		JavaProjectWizard javaProject = new JavaProjectWizard();
		javaProject.open();

		NewJavaProjectWizardPageOne javaWizardPage = new NewJavaProjectWizardPageOne(javaProject);
		javaWizardPage.setProjectName("LARS");

		javaProject.finish();
	}

	private static void createJavaClass(String name, String text) {
		NewClassCreationWizard javaClassDialog = new NewClassCreationWizard();
		javaClassDialog.open();

		NewClassWizardPage wizardPage = new NewClassWizardPage(javaClassDialog);
		wizardPage.setName(name);
		wizardPage.setPackage("test");
		wizardPage.setStaticMainMethod(true);
		javaClassDialog.finish();

		StyledText dst = new DefaultStyledText();
		dst.insertText(7, 0, text);
		new DefaultEditor().save();
	}


}
@vogella
Copy link
Author

vogella commented Jan 29, 2019

Eclipse SDK
Version: 2019-03 (4.11)
Build id: I20190127-1800
OS: Linux, v.4.18.0-13-generic, x86_64 / gtk 3.24.1, WebKit 2.22.5
Java version: 11.0.2

@odockal
Copy link
Member

odockal commented Jan 29, 2019

I am posting probably right behavior of the snippet, how it goes on fedora 29 with

Red Hat Developer Studio
Version: 12.11.0.AM1
Build id: AM1-v20190123-0556-B3891
OS: Linux, v.4.19.13-300.fc29.x86_64, x86_64 / gtk 3.24.1, WebKit 2.22.5
Java version: 11.0.1

shellresizeperformance_reddeer_externaldisplay

@odockal odockal added this to the 2.8.0 milestone Oct 8, 2019
@odockal odockal modified the milestones: 2.8.0, 2.9.0 Jan 8, 2020
@odockal odockal modified the milestones: 2.9.0, LATER Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants