Bug 105813 - the caret in the text editor doesn't update when the viewport is scrolled
Summary: the caret in the text editor doesn't update when the viewport is scrolled
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2.0 (Callisto) M4   Edit
Assignee: Pratik Shah CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-02 12:02 EDT by Takahiro Kato CLA
Modified: 2016-12-14 11:18 EST (History)
2 users (show)

See Also:


Attachments
patch for scrolling problem in the text example (6.28 KB, patch)
2005-08-02 12:12 EDT, Takahiro Kato CLA
no flags Details | Diff
patch that only contains the fix for this bug (1.94 KB, patch)
2005-08-04 12:26 EDT, Takahiro Kato CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Takahiro Kato CLA 2005-08-02 12:02:02 EDT
When the viewport is scrolled by mouse wheel or the scroll bars, the caret moves
with the viewport.  The caret should not move when the viewport is scrolled.
Comment 1 Takahiro Kato CLA 2005-08-02 12:12:53 EDT
Created attachment 25565 [details]
patch for scrolling problem in the text example

The caret should be redrawn when the viewport is scrolled.  The patch listens
to the scrolling and redraws the caret.
Comment 2 Pratik Shah CLA 2005-08-02 16:58:16 EDT
Takahiro-san, are all these changes in your patch really necessary?  Can't you 
just invoke refreshCaret() (or queueCaretRefresh()) when the range model 
changes?

Also, you don't need the configureViewer() method.  You can add the listeners 
to the viewport's range models in hookControl() (and remove them in 
unhookControl()).

One other option to fix this bug might be to invoke queueCaretRefresh() when 
update manager paints, rather than when it validates (see the update listener 
added in hookControl()).  But that's probably too agressive, so it's better to 
stick with your approach of adding listeners for scroll changes.

A couple of things to keep in mind about submitting patches.  You should 
mention whether it is to be applied to a class, package or a project.  And you 
should also add yourself to the copyright section (under contributors) of any 
classes that you modify.  Something like:
Takahiro Kato - Added code to update caret during scrolling (Bug 105813)
Comment 3 Takahiro Kato CLA 2005-08-03 18:31:14 EDT
It does contain unnecessary code.  Sorry about that, I realized that after I
submitted.  It contains a fix to some other bugs related to moving the caret
around with the arrow keys.  I'll post the better patch as soon as possible.

BTW, configureViewer() is needed because registering listeners must occur after
GraphicalTextViewer.createControl(Composite) because the
ScrollingGraphicalViewer.installRootFigure() somehow creates a new set of range
models.  I tried registering listeners in hookControl(), but because this method
is called before installRootFigure(), liteners listen to the range models that
are stale.
Comment 4 Takahiro Kato CLA 2005-08-04 12:26:50 EDT
Created attachment 25687 [details]
patch that only contains the fix for this bug

the same as the previous one except that it only contains the necessary code to
fix this bug.

again, we haven't figured out what to put in the copyright section, so I left
it as it is.
Comment 5 Pratik Shah CLA 2005-12-20 15:18:38 EST
Fixed.  The caret is refreshed when painting occurs.
Comment 6 Randy Hudson CLA 2005-12-20 15:34:44 EST
This should probably be just when validation occurs. If we change where the caret is managed, this should be revisited.
Comment 7 Alexander Nyßen CLA 2014-05-22 01:53:33 EDT
Comment on attachment 25565 [details]
patch for scrolling problem in the text example

As this patch does not seem to have been applied, marking it as obsolete.
Comment 8 Alexander Nyßen CLA 2014-05-22 03:04:00 EDT
Comment on attachment 25687 [details]
patch that only contains the fix for this bug

This patch does not seem to have been applied, thus marking as obsolete.