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

Bug 180881

Summary: [Trim] Cheese when calling Shell#layout() on invisible Shell in RCP
Product: [Eclipse Project] Platform Reporter: Benjamin Pasero <bpasero>
Component: UIAssignee: Eric Moffatt <emoffatt>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bpasero, emoffatt, ramfree17
Version: 3.3Keywords: helpwanted
Target Milestone: 3.5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 245125    
Attachments:
Description Flags
Picture showing the problem
none
Changes to using 'getVisible' in TrimLayout none

Description Benjamin Pasero CLA 2007-04-04 03:39:19 EDT
Eclipse: 3.3 M6

Steps to reproduce:
1. Create the Mail Template
2. Change the MessagePopupAction#run() method to:

window.getShell().setVisible(false);
window.getShell().layout();
window.getShell().setVisible(true);

Actual results:
The View is overlapping both the Toolbar and the Status area (see attached Screenshot).

Would be great if this could be considered as polish item for M7. I am using setVisible() in combination with the System-Tray functionality and its so annoying to have this UI glitch every time I restore the application.

Ben
Comment 1 Benjamin Pasero CLA 2007-04-04 03:41:53 EDT
Created attachment 62890 [details]
Picture showing the problem

Watch the top area of both views being hidden by the toolbar.
Comment 2 Benjamin Pasero CLA 2007-04-04 05:03:47 EDT
My first guess would be that Control#isVisible() is being used to determine if the Toolbar and Statusbar is visible instead of Control#getVisible(). So, when the Shell is invisible, any call to isVisible() from a child-control of the Shell will return FALSE. When layout() is called, I guess the View is spanning both Toolbar and Statusline because it thinks those areas are not enabled and free to occupy. 
Comment 3 Benjamin Pasero CLA 2007-04-08 12:04:06 EDT
I seem to be able to workaround this issue by calling Shell#setLayoutDeferred(true) when the shell is invisible. 
Comment 4 Eric Moffatt CLA 2007-04-24 13:25:14 EDT
Benjamin, since you indicate that you have a work-around (and I'm swamped...;-) I'm going to defer this to post 3.3.

Note that I still expect to work on RCP issues in general so this may get fixed indirectly in any case.
Comment 5 Benjamin Pasero CLA 2007-10-24 16:34:34 EDT
Ping. I am still seeing weird effects (at least some users seem to have it) that I think are caused by this (my workaround does not seem to be perfect).
Comment 6 Anuerin Diaz CLA 2008-08-20 22:15:07 EDT
This behavior also appears in Eclipse 3.3.3 when using a virtual window application (http://virtuawin.sourceforge.net). 
Comment 7 Eric Moffatt CLA 2008-08-21 13:19:37 EDT
Created attachment 110598 [details]
Changes to using 'getVisible' in TrimLayout
Comment 8 Eric Moffatt CLA 2008-08-21 13:22:48 EDT
Committed to HEAD in >20080821.

Ben, you were bang on...the TrimLayout code was using 'isVisible'.

Comment 9 Benjamin Pasero CLA 2008-08-21 14:21:20 EDT
Thanks! Please, please consider it for 3.4.1 :)
Comment 10 Eric Moffatt CLA 2008-08-25 10:49:15 EDT
Done, see bug 245125...
Comment 11 Benjamin Pasero CLA 2008-08-25 12:47:56 EDT
Cool!
Comment 12 Eric Moffatt CLA 2008-10-28 10:20:05 EDT
Verified in I20081027-1300.