Bug 106059 - [Viewers] Disappearing icon in problem view when selecting the row
Summary: [Viewers] Disappearing icon in problem view when selecting the row
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M3   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
: 144451 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-08-04 11:26 EDT by Olivier Thomann CLA
Modified: 2007-11-01 16:30 EDT (History)
5 users (show)

See Also:


Attachments
Screenshot (7.93 KB, image/png)
2005-08-04 11:27 EDT, Olivier Thomann CLA
no flags Details
Screenshot (comparison) (3.32 KB, image/png)
2005-08-30 00:12 EDT, Florian Priester CLA
no flags Details
Patch (877 bytes, patch)
2005-08-31 04:10 EDT, Florian Priester CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2005-08-04 11:26:50 EDT
Using I20050803-0800, sometimes the icon disappears when I select a problem in
the problem view. If it is unselected, it works fine.
See attached screenshot.
Comment 1 Olivier Thomann CLA 2005-08-04 11:27:12 EDT
Created attachment 25682 [details]
Screenshot
Comment 2 Florian Priester CLA 2005-08-07 05:00:33 EDT
This happens because/when the table column is not wide enough for both the
icon and the indentation (trim). Increasing the value of COLUMN_TRIM in the
JFace TableLayout class to 4px for the Win32 platform should fix the problem.

That's not to say the SWT people won't find a way to prevent clipped images
from disappearing entirely when selected.
Comment 3 Steve Northover CLA 2005-08-22 18:03:49 EDT
It's a well known, long standing bug in Windows.  Looking for the dup ...
Comment 4 Steve Northover CLA 2005-08-22 18:06:46 EDT
Can't find it.  Sorry, WONTFIX (CANTFIX).
Comment 5 Florian Priester CLA 2005-08-22 18:24:13 EDT
How about moving this bug to Platform/UI so they can consider fixing
the problem at the JFace level (see comment #2)?
Comment 6 Steve Northover CLA 2005-08-22 18:50:14 EDT
Go ahead.
Comment 7 Olivier Thomann CLA 2005-08-23 09:51:19 EDT
This worked in the past. I got it regularly with recent builds.
Comment 8 Steve Northover CLA 2005-08-29 12:07:59 EDT
You sure about that?  It's been a Windows problem for a while.  Could be a 
recent change in either SWT or JFace.
Comment 9 Olivier Thomann CLA 2005-08-29 12:12:01 EDT
No idea, but I don't remember getting it regularly with older builds.
Comment 10 Florian Priester CLA 2005-08-30 00:08:25 EDT
(In reply to comment #8)
> Could be a recent change in either SWT or JFace.

After some testing, I'd say it's not. I've modified one of the table snippets
to test this issue and was able to reproduce the problem with SWT versions
as old as v2136 (didn't check any earlier ones). Moreover, the way the
JFace TableLayout class calculates the column width did indeed change
(see bug 90712) but the actual width of the icon column did not.

I have, however, found that the icon will only disappear if you have the
javaw.exe manifest file installed. Olivier, did you recently change your
JVM installation from one without manifest to one with a manifest?
If so, this would explain why you suddenly see this bug.

The root problem still is that the icon is clipped. This shouldn't happen
in the first place. The icon itself is 16px wide and Windows adds another
4px of indentation (apparently only 2px when running without the manifest).
This adds up to 20px but the column is only 19px wide, hence the clipping.

The fix, as mentioned earlier, would be to increase the value of
TableLayout.COLUMN_TRIM to 4px for the Win32 platform, or to provide a way
to directly query the correct value from SWT (if that's possible).
Comment 11 Florian Priester CLA 2005-08-30 00:12:48 EDT
Created attachment 26611 [details]
Screenshot (comparison)

 Without manifest, column width=19
vs. with manifest, column width=19
vs. with manifest, column width=20

(A border has been added to the icon to make its bounds clearer.)
Comment 12 Olivier Thomann CLA 2005-08-30 09:25:13 EDT
(In reply to comment #10)
> I have, however, found that the icon will only disappear if you have the
> javaw.exe manifest file installed. Olivier, did you recently change your
> JVM installation from one without manifest to one with a manifest?
> If so, this would explain why you suddenly see this bug.
Yes, before I didn't use a manifest, but I had to install it for the screenshots
for the 3.1 release.
Would this problem go away if I get rid of the manifest?
Comment 13 Florian Priester CLA 2005-08-31 04:07:25 EDT
(In reply to comment #12)
> Would this problem go away if I get rid of the manifest?

Yes.
Comment 14 Florian Priester CLA 2005-08-31 04:10:36 EDT
Created attachment 26689 [details]
Patch

(This patch assumes that the current trim values for the non-Win32 platforms
are indeed correct.)
Comment 15 Olivier Thomann CLA 2005-08-31 09:24:10 EDT
I confirm that this patch is fixing the problem on Windows XP with the manifest.
Comment 16 Olivier Thomann CLA 2005-08-31 09:25:47 EDT
It also looks good when no manifest is used.
Comment 17 Boris Bokowski CLA 2006-05-30 13:04:58 EDT
*** Bug 144451 has been marked as a duplicate of this bug. ***
Comment 18 Boris Bokowski CLA 2007-06-22 10:48:55 EDT
Is this still a problem in 3.3?
Comment 19 Olivier Thomann CLA 2007-06-22 10:53:18 EDT
No, this is fine in latest build.
I don't remember exactly when this was fixed.
Comment 20 Boris Bokowski CLA 2007-06-22 12:40:46 EDT
Closing.
Comment 21 Florian Priester CLA 2007-06-22 20:42:28 EDT
The underlying problem has never been fixed. TableLayout still uses a
trim value that's too small. The icons in the Problems view no longer
disappear because the view has been changed to use the tree widget.
Comment 22 Boris Bokowski CLA 2007-06-22 21:09:33 EDT
Thanks, Florian.  Sorry for not taking the patch earlier.
Comment 23 Boris Bokowski CLA 2007-09-18 13:20:40 EDT
Moving to M3.
Comment 24 Boris Bokowski CLA 2007-10-29 00:52:18 EDT
Thanks for the patch!
Comment 25 Boris Bokowski CLA 2007-10-29 13:22:03 EDT
Fix released to HEAD.
Comment 26 Thomas Schindl CLA 2007-10-29 21:19:11 EDT
Hm, you fixed the old layout but leave the new layouts (AbstractColumnLayout) who also suffer from this very problem :-) Should I log a new bug?
Comment 27 Boris Bokowski CLA 2007-10-29 21:32:04 EDT
yes, please :-)
Comment 28 Thomas Schindl CLA 2007-10-30 11:02:17 EDT
Filed as bug 208014
Comment 29 Boris Bokowski CLA 2007-11-01 16:30:12 EDT
Verified using I20071030-0010 (by code inspection).