Bug 180881 - [Trim] Cheese when calling Shell#layout() on invisible Shell in RCP
Summary: [Trim] Cheese when calling Shell#layout() on invisible Shell in RCP
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks: 245125
  Show dependency tree
 
Reported: 2007-04-04 03:39 EDT by Benjamin Pasero CLA
Modified: 2008-10-28 10:20 EDT (History)
3 users (show)

See Also:


Attachments
Picture showing the problem (15.24 KB, image/png)
2007-04-04 03:41 EDT, Benjamin Pasero CLA
no flags Details
Changes to using 'getVisible' in TrimLayout (827 bytes, patch)
2008-08-21 13:19 EDT, Eric Moffatt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.