Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » [RESOLVED] Toolbar is painted last causing part stack to move down
[RESOLVED] Toolbar is painted last causing part stack to move down [message #1793283] Fri, 03 August 2018 02:29 Go to next message
PK Mising name is currently offline PK Mising nameFriend
Messages: 44
Registered: July 2009
Member
Hello,
I have an ugly problem where the toolbar is painted last causing the partstack to move down after the window is visible. I have tried setting breakpoints and debugging the workbench open without success.

The top of the part stack is painted right below the main menu bar. Then the top trim bar (with the toolbar) is inserted between the main menu bar and the part stack, causing the part stack to be moved down.

BTW: I noticed my eclipse IDE (Photon latest code) has the same behavior.

What is the best way to debug this issue?

Thanks.

[Updated on: Mon, 06 August 2018 01:36]

Report message to a moderator

Re: Toolbar is painted last causing part stack to move down [message #1793321 is a reply to message #1793283] Sat, 04 August 2018 04:16 Go to previous messageGo to next message
PK Mising name is currently offline PK Mising nameFriend
Messages: 44
Registered: July 2009
Member
I am hoping some of the experts in this forum can help me. After painstaking debugging for hours, I see that runDeferredLayouts() in the Display class is what causes the Top TrimBar (and the tool bars within it) to be painted. That causes the main PartStack to be resized. How can this be avoided? How can the TrimBars be laid out before the windows opens?
Re: Toolbar is painted last causing part stack to move down [message #1793341 is a reply to message #1793321] Mon, 06 August 2018 01:47 Go to previous message
PK Mising name is currently offline PK Mising nameFriend
Messages: 44
Registered: July 2009
Member
Hello,
After a couple of days of painstaking troubleshooting, I was able to figure out the reason for this shit and fix it. When the 3.x layer is in control of the E4 startup, the application is lauched by calling
PlatformUI.createAndRunWorkbench(display, new AppWorkbenchAdvisor());


This eventually lands startup execution in the following method in the WBWRenderer class:
 public void postProcess(MUIElement shellME) 


Within this method there is a call to a method called "forceLayout(shell)". This method is as follows:
private void forceLayout(Shell shell) {
		int i = 0;
		while(shell.isLayoutDeferred()) {
			shell.setLayoutDeferred(false);
			i++;
		}
		while(i > 0) {
			shell.setLayoutDeferred(true);
			i--;
		}
	}


Solution:
Create a custom workbench renderer, and create a method similar to postProcess and remove the call to the "forceLayout(shell)" method. That causes all the trim bars to be laid out, before the shell is opened and made visible.
Previous Topic:How to apply CSS style to MCompositePart?
Next Topic:[RESOLVED]Toolbar causes editors tab to move down after window open
Goto Forum:
  


Current Time: Sat Apr 20 04:32:41 GMT 2024

Powered by FUDForum. Page generated in 0.03204 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top