Bug 579179 - [Multiple carets] Text component gaining focus only draws first caret
Summary: [Multiple carets] Text component gaining focus only draws first caret
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.23   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.24 M1   Edit
Assignee: Dirk Steinkamp CLA
QA Contact:
URL:
Whiteboard:
Keywords: ui
Depends on:
Blocks:
 
Reported: 2022-03-09 14:58 EST by Dirk Steinkamp CLA
Modified: 2022-03-11 09:31 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Steinkamp CLA 2022-03-09 14:58:11 EST
From https://bugs.eclipse.org/bugs/show_bug.cgi?id=579028#c7:

> When an editor loses focus and then gains it again, only the "blinking OS caret" 
> is drawn, but the other virtual carets are not updated/drawn until the caret 
> moves. This is because Composite.setFocus() -> ... -> Caret.setFocus() doesn't 
> know of extra carets, and thus only shows one caret.
> A remedy would be to add an implementation for StyledText.setFocus() like this:
>    @Override
>    public boolean setFocus() {
>    	boolean b = super.setFocus();
>    	setCaretLocations();
>    	return b;
>    }
>
> This takes care of the drawing of the extra carets.
Comment 1 Eclipse Genie CLA 2022-03-09 15:17:46 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/191674
Comment 3 Mickael Istria CLA 2022-03-10 11:19:12 EST
Thanks Dirk!