Bug 550326 - [Quicksearch] Entry selection in Quick Search dialog
Summary: [Quicksearch] Entry selection in Quick Search dialog
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.13   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Paul Pazderski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 548518
  Show dependency tree
 
Reported: 2019-08-22 06:14 EDT by Noopur Gupta CLA
Modified: 2020-04-18 09:40 EDT (History)
6 users (show)

See Also:


Attachments
Windows - screenshot (28.68 KB, image/png)
2019-08-22 06:14 EDT, Noopur Gupta CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Noopur Gupta CLA 2019-08-22 06:14:17 EDT
Created attachment 279658 [details]
Windows - screenshot

I20190821-1800

Selecting a result in Quick Search dialog results in extra lines around the entry on Windows OS. See attached screenshot. Notice the two lines on the left of the line number on the selected entry.
Comment 1 Paul Pazderski CLA 2019-08-22 06:57:44 EDT
I wouldn't be surprised if this is intentional to avoid bug 549901. The "first" column is right aligned which is impossible according to bug 549901.
Comment 2 Mickael Istria CLA 2019-08-22 12:50:05 EDT
(In reply to Paul Pazderski from comment #1)
> I wouldn't be surprised if this is intentional to avoid bug 549901. The
> "first" column is right aligned which is impossible according to bug 549901.

@Kris: do you confirm?
Comment 3 Kris De Volder CLA 2019-08-23 12:17:08 EDT
> Kris: do you confirm?

I can't sat that this was 'intentional' per-se, but it is true that we want that column to be 'right aligned'.

I think the extra lines are there because of how SWT draws the line when the label has some spaces in front (padding to make things align as desired).

To be totally honest, I never noticed these extra lines and so never thought of it as a 'bug'.
Comment 4 Paul Pazderski CLA 2019-08-23 12:34:31 EDT
Strange thing. In fact I could not find any code for my initial guess there might be an empty first column. And my assumption the trick might be in JFace's TableViewer was ruined from the fact that it can not right align the first column. Only in Quick Search Dialog it is right aligned.

My new guess were the empty 1x1 pixel image set for each cell but removing them change nothing.

Also your padding guess seem to be a false memory. I can not find any padding for the line number.

Kris from my point of view you did what should be impossible and then forget who you did this miracle. :D
Comment 5 Kris De Volder CLA 2019-08-23 13:01:23 EDT
The one-pixel image rings a bell somewhere in my (possibly false :-) memories.

I don't think it has anything to do with label alignment. It was a workaround for some drawing glitch that affected SWT GTK on some very specific operating systems. Something would go completely off the rails and draw the same content in every cell. If I recall correctly it only happened on very specific OS and specific version of GTK. The reason for it was never explained, but I found that only quicksearch was affected and not other table viewers. And the thing that made them different was the other viewers all had icon/images. Adding a 'invisible' image somehow made the bug go away.

I did report this drawing glitch to Eclipse bugzilla, but not sure how to find it. I don't think it was ever fixed but its specificity to some specific os / and gtk version probably means its no longer necessary to do this workaround.
Comment 6 Kris De Volder CLA 2019-08-23 13:07:36 EDT
ACtually... found the 'one pixel' image reason/bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=478838
Comment 7 Kris De Volder CLA 2019-08-23 13:20:40 EDT
> Kris from my point of view you did what should be impossible and then forget who you did this miracle. :D


I don't actually have any recollection of experiencing difficulties with the alignment of the line numbers column. So it probably just worked for me and, for whatever reason, our dialog didn't hit https://bugs.eclipse.org/bugs/show_bug.cgi?id=549901
Comment 8 Paul Pazderski CLA 2019-08-23 14:48:35 EDT
Finally found something. The magic lies in StyledCellLabelProvider. It is an OwnerDrawLabelProvider so in this case not Windows and its troublesome interpretation of alignment is responsible for the first column but Eclipse code which actual respects the alignment.

So the extra line in the screenshot may come from this label provider or is at least related to the fact we and not Windows is painting the table.

Also if you look closely there is actually no extra line but the line which should lie on the bottom make a swing to the top.
Comment 9 Paul Pazderski CLA 2019-08-23 15:32:27 EDT
I modified a JFace example for testing. You can find it here: https://git.eclipse.org/r/#/c/148251/
(also includes an experimental but probably not final fix)

I think we have two similar problems. One for full row select on and off. Both are related to Windows alignment problems.

For full row select off the fix is probably simple. Will provide one soon.
For full row select on I'm not yet sure but will investigate.
Comment 10 Dani Megert CLA 2020-04-18 09:40:41 EDT
Paul, are you planning to work on this for 4.16?