Bug 353503 - [10.7][hovering][navigation] wrong size of pop-up dialog for multi-hyperlink
Summary: [10.7][hovering][navigation] wrong size of pop-up dialog for multi-hyperlink
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 3.7.1   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 354691 357427 357760 (view as bug list)
Depends on:
Blocks: 355683
  Show dependency tree
 
Reported: 2011-08-01 10:30 EDT by Alexandr Bolbat CLA
Modified: 2011-09-15 07:06 EDT (History)
10 users (show)

See Also:
eclipse.felipe: review+


Attachments
screenshot (1.74 MB, image/jpeg)
2011-08-01 10:52 EDT, Alexandr Bolbat CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Bolbat CLA 2011-08-01 10:30:40 EDT
Build Identifier: 20110615-0604

Don't know how this happen but now i have wrong size of popup dialogue for hyperlink's
Now i see small window only with first element
I don't know how to reset size of this dialogue to default for showing possible "hyperlink variant's"
Maybe this related to last OS update - Mac OS X Lion - because in my old eclipse (3.6) i see the same situation

Reproducible: Always

Steps to Reproduce:
1. Open eclipse
2. Open some Java class
3. Try to open "hyperlink's" popup for some type from this code editor by pressing CMD button and focusing mouse on it (needed type)
Comment 1 Alexandr Bolbat CLA 2011-08-01 10:52:12 EDT
Created attachment 200659 [details]
screenshot
Comment 2 Alexandr Bolbat CLA 2011-08-01 14:12:27 EDT
This problem in my 3.7 and 3.6 eclipses
Comment 3 Alexandr Bolbat CLA 2011-08-01 18:54:05 EDT
I found cause and solution for this problem.

Cause: new mac os x lion with new general UI setting's for scrollbar's

By default in mac os x lion: System Preferences -> General
Option: Show scroll bars - stetted to: Automatically based on input device
And with this choice eclipse show bugged size for this popup window (maybe in some other places else)
But when we change this option to: Always - problem dissapear - popup opens with right sizes and show all element's correctly 

P.S. I think you guys can handle this workaround in code for next releases/patches....

Best Regards
Bolbat Alexandr
Comment 4 Dani Megert CLA 2011-08-02 03:15:32 EDT
I don't have a Mac with Lion installed. I suspect that SWT returns values for either fTable.getVerticalBar() or fTable.getVerticalBar().getSize() which don't match the rendered control.

Affected code in JFace Text is in MultipleHyperlinkPresenter.LinkListInformationControl.computeSizeHint().


See also bug 352990.
Comment 5 Silenio Quarti CLA 2011-08-05 12:20:49 EDT
The problem here is that the scrollbars are not a part of the trim anymore when the system settings is "When Scrolling".  They overlay over the content view and they do not take any space.  Note that this needs the fix for bug#348309.

I believe Table.computeSize() and Table.computeTrim() are correct. They add the scrollbar space depending on the system setting.

ScrollBar.getSize() is correct as well.  It says the scrollbar is 15 pixels. 

The problem is that  MultipleHyperlinkPresenter.LinkListInformationControl.computeSizeHint() removes the size of the scroll bar all the time from the compute size.

I am not quite sure what to do. We could:

1) add API to determine that the scrollbar is not a part of the trim
2) change ScrollBar.getSize() to return 0 even though the size is not really zero which seems unsafe.
Comment 6 Silenio Quarti CLA 2011-08-05 14:04:03 EDT
There is also a third option:

3) Always include the scroll bars in computeSize() and computeTrim().
Comment 7 Dani Megert CLA 2011-08-06 03:13:37 EDT
> 1) add API to determine that the scrollbar is not a part of the trim
This would mean that all clients which got broken have to change their code.
Comment 8 Markus Keller CLA 2011-08-07 09:31:26 EDT
The LinkListInformationControl's way of dealing with scrollbars is quite special. I guess it's OK that we have to adapt this code to support the new behavior.

> 1) add API to determine that the scrollbar is not a part of the trim
This should already be available through ScrollBar#getThumbTrackBounds().

> 2) change ScrollBar.getSize() to return 0 even though the size is not really
> zero which seems unsafe.
I agree this sounds wrong.

> 3) Always include the scroll bars in computeSize() and computeTrim().
I guess that would cause collateral damage in other places.
Comment 9 Dani Megert CLA 2011-08-08 02:44:15 EDT
(In reply to comment #8)
> The LinkListInformationControl's way of dealing with scrollbars is quite
> special. I guess it's OK that we have to adapt this code to support the new
> behavior.

I guess we could live with that but should mention it in the migration guide.
Comment 10 Neil Bartlett CLA 2011-08-13 15:25:34 EDT
*** Bug 354691 has been marked as a duplicate of this bug. ***
Comment 11 Neil Bartlett CLA 2011-08-13 15:26:43 EDT
Note this bug also affects the Quick Editor Switcher popup. Screenshot attached to bug 354691.
Comment 12 Dani Megert CLA 2011-08-15 11:38:27 EDT
(In reply to comment #11)
> Note this bug also affects the Quick Editor Switcher popup. Screenshot attached
> to bug 354691.

Depends on the fix. The switcher uses SWT's org.eclipse.swt.custom.TableEditor.
Comment 13 Markus Keller CLA 2011-08-22 16:19:53 EDT
> > 1) add API to determine that the scrollbar is not a part of the trim
> This should already be available through ScrollBar#getThumbTrackBounds().

Hmm, this is getting ugly. At the time when we compute the sizes, the Table has size {0, 0} and thus getThumbTrackBounds() also doesn't return anything of interest.

If SWT could add an explicit API like ScrollBar#isOverlay(), that would be great and it would also make other similar fixes easier to implement.
Comment 14 Markus Keller CLA 2011-08-23 06:17:56 EDT
The Quick Editor Switcher popup (bug 354691) computes the size in AbstractTableInformationControl#inputChanged(Object, Object).

    tableSize.y - viewerTable.getItemHeight() - viewerTable.getItemHeight() / 2
is bogus, but even after replacing this with something like
    viewerTable.getHorizontalBar().getSize().y
, we still need to know whether the scrollbars are overlays or not.
Comment 15 Silenio Quarti CLA 2011-08-23 15:16:29 EDT
I believe the safest fix at this point is:

3)  Always include the scroll bars in computeSize() and computeTrim().

given that we would not be able to add API in the 3.7 branch.

Fixed in 3.8 branch.

Felipe, please review for 3.7.1.

http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=0299941c68a463c97176c9da97b333292c2da0fb
Comment 17 Silenio Quarti CLA 2011-08-23 15:37:58 EDT
Fixed in 3.7.1 branch as well.
Comment 18 Dani Megert CLA 2011-08-24 02:00:04 EDT
> 3)  Always include the scroll bars in computeSize() and computeTrim().
> 
> given that we would not be able to add API in the 3.7 branch.
This is not given, but needs PMC approval.
Comment 19 Markus Keller CLA 2011-08-24 06:31:37 EDT
With the last change, the textWidget.computeTrim(0, 0, 0, 0) in SourceViewer.RulerLayout#layout() now returns a fake trim with width and height of 15. This is too big. The legacy scrollbars have size 15, but the overlay scrollbars are only 10 pixels.
Comment 20 Silenio Quarti CLA 2011-08-24 11:29:42 EDT
The overlay scrollbars seem smaller to me as well, but I still get 15 pixels if I call:

[NSScroller scrollerWidthForControlSize: NSRegularControlSize scrollerStyle: NSScrollerStyleOverlay]
Comment 21 Dani Megert CLA 2011-09-13 01:12:47 EDT
*** Bug 357427 has been marked as a duplicate of this bug. ***
Comment 22 Dani Megert CLA 2011-09-13 01:13:17 EDT
(In reply to comment #19)
> With the last change, the textWidget.computeTrim(0, 0, 0, 0) in
> SourceViewer.RulerLayout#layout() now returns a fake trim with width and height
> of 15. This is too big. The legacy scrollbars have size 15, but the overlay
> scrollbars are only 10 pixels.

Are we happy with the current solution?
Comment 23 Markus Keller CLA 2011-09-13 08:54:22 EDT
(In reply to comment #22)
> Are we happy with the current solution?

Yes. I don't see any negative effects of this in the UI.

The only remaining real issue is bug 355683. I mentioned the wrong size in that bug as well, so maybe it can be fixed there. Or it just stays until somebody has a real problem with it.
Comment 24 Dani Megert CLA 2011-09-15 07:06:42 EDT
*** Bug 357760 has been marked as a duplicate of this bug. ***