Bug 543951 - Line ruler update after quick fix Refactor->Rename in Workspace depends on layout call in ProgressIndicator
Summary: Line ruler update after quick fix Refactor->Rename in Workspace depends on la...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.11   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.11 M3   Edit
Assignee: Sebastian Ratz CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted, performance
Depends on:
Blocks: 528031
  Show dependency tree
 
Reported: 2019-01-29 12:20 EST by Lars Vogel CLA
Modified: 2019-01-31 05:01 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2019-01-29 12:20:07 EST
See Bug 530188, the update of the line ruler depends incorrectly on the layout() call in the ProgressIndicator class.

To verify:

Replace the layout calls in ProgressIndicator with requestLayout calls.

Now use the example from Bug 530188 with the simple class below:

----------------
public class C {
}
----------------

Open Java editor on this class.
Place cursor after "C" and Ctrl+1 -> Rename in Workspace -> "D". 
After confirmation, the line numbers are gone from editor forever. 
To see them again, one need to re-open the editor.

This works fine if the "Rename" is executed as a context menu from Package Explorer.

Expectation: Line ruler update should not depend on the layout call of the ProgressIndicator.
Comment 1 Eclipse Genie CLA 2019-01-30 11:22:11 EST
New Gerrit change created: https://git.eclipse.org/r/136030
Comment 2 Sebastian Ratz CLA 2019-01-30 11:35:52 EST
I think I haven seen this problem occur even with a regular layout() in ProgressIndicator -- probably caused by some other operation which deferred a layout on the same Shell.

I created a Gerrit change which fixes the problem (using requestLayout in 
ProgressIndicator now works fine).

The fix seems reasonable to me, especially since the javadoc on method layoutTextViewer says that the ruler is also layed out.

I suspect that the fact that requestLayout() just marks the Widgets to be in a deferred state causes different behavior for a layout().

Interestingly, changing the layout(true, true) to requestLayout() in CompositeRuler does *not* fix the problem alone. But also calling requestLayout on the LineNumberRulerColumn$2 canvas itself does.

I guess there is no equivalent to layout(true,*true*) requestLayout() which also marks all children for deferred update.

Is there something else going on (maybe like bug 497812)?
Comment 4 Lars Vogel CLA 2019-01-31 04:59:02 EST
Thanks, Sebastian.