| Summary: | [10.7] [rulers] The right vertical ruler is missing after Mac OS X Lion installation... | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Mostafa Zeinali <zeinali_mostafa> | ||||||||||
| Component: | Text | Assignee: | Markus Keller <markus.kell.r> | ||||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | aisling.mathews, beafdefx, cholpas, daniel_megert, eclipse.felipe, fabien, ian, lshanmug, maik, markus.kell.r, mn, pinnamur, remy.suen, Silenio_Quarti, thashef, thatnitind, trip, ts, yozh | ||||||||||
| Version: | 3.7 | Flags: | daniel_megert:
review+
|
||||||||||
| Target Milestone: | 3.7.1 | ||||||||||||
| Hardware: | Macintosh | ||||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Mostafa Zeinali
Maybe you have different scroll bar settings on those two machines? Did you maybe choose to hide the scroll bars? Markus, can you take a look? > Markus, can you take a look?
Sorry, I don't have a Lion install yet. Moving to SWT to see if this is a serious issue that needs to be fixed for 3.7.1.
Suspects are wrong values returned by ScrollBar#getThumbBounds() and getThumbTrackBounds(). We call both methods from the org.eclipse.jface.text plug-in. I also expect to get reasonable values from these methods if the scroll bar is not currently shown.
I had a quick look on a colleague's Lion install, and I didn't see any problem in a Java editor overview ruler. Mostafa, can you please attach a screenshot and tell which setting you use for showing scrollbars? I mean this one: http://arstechnica.com/apple/reviews/2011/07/mac-os-x-10-7.ars/3#scroll-bar-preference Created attachment 200583 [details]
Screenshot
I can reproduce this bug on my computer, as well as on my colleague's computer. Both running Lion Mac OS.
I added a screenshot showing that neither errors nor occurrences are shown in the right vertical bar. This is very annoying when working with large files.
I also tried modifying the system preferences, but that didn't help.
http://stackoverflow.com/questions/6780269/running-eclipse-on-mac-os-x-lion Problem exists when "Show scroll bar" preference is set to "Always on". Created attachment 200935 [details]
fix
Scrollbars on Mac Lion do not have arrow buttons, so the track size is always the whole width/height of the scroll bar and the arrow buttons height are always zero. The method org.eclipse.jface.text.SourceView.getVerticalScrollArrowHeights() uses some math to calculate the arrows height when the values calculated using SWT API return 0,0, but 0,0 are valid values.
This patch fixes the problem by allowing the arrow heights to be 0,0.
Note that ScrollBar.getThumbTrackBounds() returns funny values when the scrollbars have not been layed out yet, but these do not seem to cause any problems.
Markus, please verify once you have Lion. I'll have a Lion install in about 10 days. (In reply to comment #6) I fail to see why this patch would fix the problem. Even if both heights are 0, the else branch should still set fScrollArrowHeights to {0, 0} (after a detour trying the same with an enlarged text widget). The code in org.eclipse.jface.text.source.SourceViewer.RulerLayout#layout(Composite, boolean) should already handle the situation with no arrows (since this could already be set before with e.g. TinkerTool). This is a really wacky error from my point of view. I had a workspace on Lion that wouldn't show any overview annotations at all no matter what setting I toggled. Then I created a new workspace and new Java project that happened to have some errors in a Java file that started to show some annotations in the overview, but they were not all correct. One annotation just said "Line 1" without any details. Then I switched back to my workspace that never showed an annotation and suddenly they were present. Switching back to the workspace that had problems suddenly had no problem with overview annotations. Later, on that same machine, I created a new workspace with a new project and was able to get overview annotations. On another machine, I had a workspace that had been created on Snow Leopard, then converted to Lion. No overview annotations. At some point I did a file search, then annotations were showing up in the overview. On yet another machine, I had a workspace that had been created on Snow Leopard, then converted to Lion. No annotation problems at all. There is definitely something weird going on with overview annotations, but I can't put my finger on it. To repro, my recommendation would be to try a fresh install of Eclipse Indigo on a fresh workspace on a fresh install of Lion and see what happens. When overview annotations are not working, I noticed that right clicking in the annotations column doesn't yield the "Preferences..." context menu option that you'd normally see if it was working. Sorry this is so inconclusive, but something is definitely broken under some unknown circumstances. No changes to OSX scrollbar behaviors on my side had any effect. This is all I know (and I'm annoyed by it)! *** Bug 355204 has been marked as a duplicate of this bug. *** Created attachment 201950 [details] fix 2 The problem is that ScrollBar#getThumbTrackBounds() returns massively wrong values for x and y when the StyledText and its vertival ruler have zero height. The huge value of y makes us reserve the whole area for the top arrow, leaving nothing for the actual information. My fix detects the zero-height situation and fixes the problem locally. This patch also fixes a second layouting problem that occurs when the OS preference is set to "When scrolling": In that case, there's an ugly gray box below the vertical ruler (on the left) that even hides the last line number. This fix is based on master / R3_7_maintenance of SWT which includes the fix for bug 348309. Fixed in HEAD. No visible change on Windows (as expected). Dani, please review and approve for 3.7.1. +1 to fix it in 3.7.1.
Regarding the patch:
- The '6' used in the code either needs a comment or a constant with a speaking
name.
- 'measuredScrollbarHeight' we don't need this. Simply move the adjustment code
for the overview ruler inside the if (overviewRulerWidth != -1) {...}
==>
if (overviewRulerWidth != -1) {
if (scrollbarHeight <= 0)
scrollbarHeight= overviewRulerWidth;
...
}
- The 3.7.1 fix also needs to update the bundle version.
Created attachment 201983 [details] fix 3 Final fix for 3.7.1, including all changes from comment 13. Fixed in R3_7_maintenance. Verified in Linux that scroll bars look OK. Verified in M20110825-0847 on 10.7 that the overview ruler is visible and scrollbars are OK with both OS settings (static and dynamic scroll bars) in the editor, in hyperlink popup (Command + hover), in the editor switcher (Command+E), and in text compare editors. Lakshmi, could you please verify these scenarios on 10.6 Cocoa? Verified the above scenarios in M20110825-0847 build on 10.6. svn diff scroll bar not displaying I would just like to add to this, that although I haven't had a problem seeing the scroll bars in most places, when I do an svn diff (Compare with xyz) I can't see any scroll bar when in the system "Show scroll bars when scrolling" mode. (In reply to comment #19) > svn diff scroll bar not displaying If they use the normal Eclipse compare editors, then this problem should be fixed with the fix for bug 353503. Please try a recent build (>= M20110825-0847 or I20110830-0800). *** Bug 356949 has been marked as a duplicate of this bug. *** This also affects Eclipse 3.6 SR2 if that matters to anyone. *** Bug 357617 has been marked as a duplicate of this bug. *** *** Bug 363441 has been marked as a duplicate of this bug. *** |