Bug 566185 - [WIN32] StyledText: horizontal scrollbar flickers with SWT.MULTI | SWT.V_SCROLL and setAlwaysShowScrollBars(false)
Summary: [WIN32] StyledText: horizontal scrollbar flickers with SWT.MULTI | SWT.V_SCRO...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.17   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-19 04:24 EDT by Lars Vogel CLA
Modified: 2020-10-02 15:03 EDT (History)
3 users (show)

See Also:


Attachments
Screencast (1.22 MB, image/gif)
2020-08-19 04:24 EDT, Lars Vogel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2020-08-19 04:24:12 EDT
Created attachment 283905 [details]
Screencast

See screencast, if I type under Window s in the last line of the Staging view, I get a annoying flickering. Might be an SWT issue, as I do not observe that under Linux. Please move to SWT if you also think this is the case.
Comment 1 Thomas Wolf CLA 2020-08-19 08:18:03 EDT
No idea. Looks like some smart scrollbar stuff interferes. Can you reproduce anywhere else, such as in a JFace snippet?
Comment 2 Michael Keppler CLA 2020-08-29 10:06:11 EDT
I'm certain that is a duplicate of bug 565019 (relayout of commit message component on each key stroke). When Lars is typing "immer", then you can see the warning above the textbox flashing.
Comment 3 Thomas Wolf CLA 2020-10-01 03:50:53 EDT
@Lars: could you check whether this is resolved in EGit nightly (5.10.0.202010010713 or newer)? If so, we can close this as a duplicate of bug 565019.
Comment 4 Lars Vogel CLA 2020-10-01 10:41:55 EDT
(In reply to Thomas Wolf from comment #3)
> @Lars: could you check whether this is resolved in EGit nightly
> (5.10.0.202010010713 or newer)? If so, we can close this as a duplicate of
> bug 565019.

Unfortunately this bug is still present.
Comment 5 Thomas Wolf CLA 2020-10-01 16:33:23 EDT
So not a duplicate. Not sure it's an EGit problem, though. Could you please answer the question from comment 1?
Comment 6 Thomas Wolf CLA 2020-10-02 11:44:05 EDT
This is an SWT problem. Can be reproduced by the following code (derived from SWT Snippet 244):

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class Snippet244a {

  public static void main(String[] args) {
    final Display display = new Display();
    Shell shell = new Shell(display);
    shell.setText("Snippet 244"); //$NON-NLS-1$
    shell.setLayout(new FillLayout());
    final StyledText text = new StyledText(shell,
        SWT.MULTI | SWT.V_SCROLL);
    text.setAlwaysShowScrollBars(false);
    String contents = "This demonstrates drawing a box\n"
      + "around every occurrence of the word\n"
      + "box in the StyledText"; //$NON-NLS-1$
    text.setText(contents);
    shell.pack();
    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) display.sleep();
    }
    display.dispose();
  }
}

Type additional lines so that the vertical scrollbar appears. Then keep typing (anywhere, not just on the last line). Horizontal scrollbar flickers into and out of existence.

Seems to be caused by setAlwaysShowScrollBars(false).
Comment 7 Thomas Wolf CLA 2020-10-02 15:03:59 EDT
Issue was originally reported against the EGit staging view, which uses SWT.MULTI | SWT.V_SCROLL | SWT.WRAP and setAlwaysShowScrollBars(false).

Expected behavior is that this never needs a horizontal scroll bar and
shows the vertical scrollbar if needed. Which it does, but it causes the
horizontal scrollbar to appear briefly and the disappear again on each character typed.

On OS X this flickering does not occur.