| Summary: | SWT on GTK gets garbled after 7710 characters in a Text component | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Rob Clevenger <rcleveng> | ||||||
| Component: | SWT | Assignee: | Bogdan Gheorghe <gheorghe> | ||||||
| Status: | CLOSED NOT_ECLIPSE | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | caniszczyk, ericwill, jamesblackburn+eclipse, konigsberg, loskutov, Mike_Wilson, snorthov | ||||||
| Version: | 3.5 | Keywords: | triaged | ||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 110848 [details]
7800 characters
This is a bug in the display driver for Linux. Do we have a FAQ for this somewhere? I searched here for bugs, and also looked at http://www.eclipse.org/swt/faq.php and didn't find any mention of this. I was asking Bogdan if we has a FAQ but thanks for looking! There is a problem in many display drivers (on Windows too) where long text gets garbled. We've been unable to work around it. I'll let Bogdan find the old bug report and mark this as a dup. This bug gets reported every once in a while and there's not much we can do. A GTK C program has the same failure. (In reply to comment #4) > I was asking Bogdan if we has a FAQ but thanks for looking! There is a problem > in many display drivers (on Windows too) where long text gets garbled. We've > been unable to work around it. I'll let Bogdan find the old bug report and > mark this as a dup. > > This bug gets reported every once in a while and there's not much we can do. A > GTK C program has the same failure. > What's the bug # on GTK? What about truncating read only text components, labels etc? I'm getting bugs logged against me for my product that builds on top of eclipse for this in the Eclipse Build Paths page, truncating it there seems like sort of a hack to me. *** Bug 189050 has been marked as a duplicate of this bug. *** Just adding my @google.com address to this issue. Can somebody on SWT provide the GTK bug # that this is dependent upon? Thanks.! Is there any workaround available/possible? I'm just curious: if this is a *display* driver, then: 1) Why this bug is limited only to GTK+ applications? I can see/edit such long lines perfectly in nedit and kwrite. 2) Are there *better* display drivers known, where GTK+ can render long lines, or is this just bug in GTK+ itself? Ah, I see this a lot too -- it's especially annoying when debugging and the variables view detail pane tries to display data formatted as a very long string... Nice to know I don't just have a broken gtk. There are a couple of upstream bugs: Overlapping characters: http://bugzilla.gnome.org/show_bug.cgi?id=90919 Performance Issues with Long lines: http://bugzilla.gnome.org/show_bug.cgi?id=114337 The overlapping characters bug (90919) seems to pinpoint Cairo as the culprit... Changing Version tag to something more believable. Upstream tickets seem to be fixed, going to close this one. Please reopen it if you continue to experience this issue on GTK3.22/4.8. |
Created attachment 110847 [details] 7711 characters Build ID: I20080617-2000 Steps To Reproduce: I've seen this in Eclipse dialogs (mainly the BuildPathsBlock listing out the included and excluded nodes in the tree). When you have too much text in a SWT control (7710 seems to be the magic number), it falls over and wraps on top of itself causing garbled text. I made a simple Eclipse command handler with this code to demonstrate the problem. update 7711 with some larger value to see the text get more garbled (as it is, only the 1st character looks off with 7711 characters since 7710 seems to be the limit where this starts wrapping. This is NOT limited to Text components though, since I've seen in the in org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListLabelProvider More information: package foo.handlers; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.handlers.HandlerUtil; import org.eclipse.jface.dialogs.Dialog; /** * Our sample handler extends AbstractHandler, an IHandler base class. * @see org.eclipse.core.commands.IHandler * @see org.eclipse.core.commands.AbstractHandler */ public class SampleHandler extends AbstractHandler { /** * The constructor. */ public SampleHandler() { } /** * the command has been executed, so extract extract the needed information * from the application context. */ public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); MyDialog d = new MyDialog(window.getShell()); d.open(); return null; } static class MyDialog extends Dialog { protected MyDialog(Shell parentShell) { super(parentShell); } @Override protected Control createDialogArea(Composite parent) { StringBuilder s = new StringBuilder(100* 1000); for (int i=0; i < 7711; i++) { s.append((char) ((i % 26) + 65)); } Composite c = (Composite) super.createDialogArea(parent); c.setLayout(new GridLayout(1, false)); new Label(c, SWT.CENTER).setText("Hello World"); Label l = new Label(c, SWT.NONE); l.setText(s.toString()); l.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1)); Text t = new Text(c, SWT.BORDER |SWT.SINGLE); t.setText(s.toString()); t.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1)); this.getShell().setSize(1010, 400); return c; } @Override public int open() { return super.open(); } } }