Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318139

Summary: [CSS] theme switching opens/closes an empty window
Product: [Eclipse Project] Platform Reporter: Kai Toedter <kai.toedter>
Component: UIAssignee: Remy Suen <remy.suen>
Status: VERIFIED FIXED QA Contact: Eric Moffatt <emoffatt>
Severity: normal    
Priority: P3 CC: daniel.esser, emoffatt, remy.suen
Version: 4.2   
Target Milestone: 4.2 M6   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Kai Toedter CLA 2010-06-28 02:48:47 EDT
Check out the latest e4 contacts demo from cvs. Switch themes. Under Windows you will notice that a new window is opened temporarily and destroyed immediately. This takes just milliseconds but you see it.
Comment 1 Remy Suen CLA 2011-02-21 14:41:18 EST
I don't see this on Windows 7.

Kai, if you're still seeing this, please use breakpoints and see when the shell is constructed and/or made visible.
Comment 2 Kai Toedter CLA 2011-03-14 11:25:57 EDT
I still see this on 64bit Windows 7 running a 32bit Java/Eclipse
Class ThemeEngine, line 330:

Shell[] shells = display.getShells();
for (Shell s : shells) {
	try {
		s.setRedraw(false);
		s.reskin(SWT.ALL);
		applyStyles(s, true);
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	} finally {
		s.setRedraw(true); <==== This causes it
	}
}

If I comment out both s.setRedraw()s, the switching is not as smooth but no Shell is popping up.
Comment 3 Remy Suen CLA 2011-06-03 09:53:09 EDT
(In reply to comment #0)
> Check out the latest e4 contacts demo from cvs. Switch themes. Under Windows
> you will notice that a new window is opened temporarily and destroyed
> immediately.

Kai, is this a completely new window that you see? Or is it something "overlaid" on top of the demo's window?
Comment 4 Kai Toedter CLA 2011-06-03 10:06:26 EDT
a big empty shell (new window) pops up for a millisecond just behind the application's main window. This happens at startup and every time I switch the theme.
Comment 5 Remy Suen CLA 2011-06-03 10:10:11 EDT
(In reply to comment #4)
> a big empty shell (new window) pops up for a millisecond just behind the
> application's main window. This happens at startup and every time I switch the
> theme.

Please use a breakpoint in Shell to see if a new one is being constructed or an existing one is being made to be visible.
Comment 6 Eric Moffatt CLA 2011-11-09 09:47:47 EST
This is the 'limbo' shell being styled (the CSS all styles the shell's background color). Technically this is an SWT defect since invisible shells shouldn't 'flash' when styled.

For now I'll change the code to place the limbo shell 'off screen' (y=10000) and then open a second defect for SWT...
Comment 7 Eric Moffatt CLA 2011-11-09 09:51:17 EST
Pushed in >20111109.

commit b08151e2f315bbef4bfa69123d450f0f2421aa6f

Kai, let me know if this doesn't address the issue...
Comment 8 Eric Moffatt CLA 2011-11-09 09:54:26 EST
I've opened Bug 363322 for the SWT...
Comment 9 Eric Moffatt CLA 2011-12-08 15:12:24 EST
Verified (viw code inspection) in I20111205-2330.
Comment 10 Kai Toedter CLA 2011-12-29 05:41:38 EST
Eric, I still see the bug in the current git master.
Comment 11 Remy Suen CLA 2012-02-10 14:50:27 EST
(In reply to comment #10)
> Eric, I still see the bug in the current git master.

I'm seeing this now and have figured out the cause.
Comment 12 Remy Suen CLA 2012-02-10 14:59:03 EST
Fix pushed to master.
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=fc249c2be4fb75fb2cc37fb70546c288642a234f

Sorry for taking so long to fix this, Kai.
Comment 13 Kai Toedter CLA 2012-02-13 02:38:39 EST
great that this is fixed now, for me this was a killer...
Comment 14 Remy Suen CLA 2012-03-13 10:09:57 EDT
Verified by source code inspection with I20120312-1730.
Comment 15 Kai Toedter CLA 2012-03-13 10:15:32 EDT
Verified by tests under Windows 7 with current master