Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313223

Summary: StyledText slow to update due to deferred flushing
Product: [Eclipse Project] Platform Reporter: Scott Kovatch <skovatch>
Component: SWTAssignee: Scott Kovatch <skovatch>
Status: RESOLVED FIXED QA Contact: Silenio Quarti <Silenio_Quarti>
Severity: normal    
Priority: P3 CC: gheorghe
Version: 3.6Flags: Silenio_Quarti: review+
gheorghe: review+
Target Milestone: 3.6 RC2   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Scott Kovatch CLA 2010-05-17 15:12:13 EDT
I20100511-0800

The content of a StyledText doesn't keep up with your keystrokes. You can see this in CustomControlExample.

1. Launch CustomControlExample.
2. Switch to StyledText.
3. Check the HORIZONTAL_FILL and VERTICAL_FILL checkboxes.
4. Start typing at a fast pace.

The text doesn't appear immediately. It seems to take a fraction of a second for the text you just typed in to repaint. Compare with a multiline Text, where there is no noticeable delay after typing.
Comment 1 Scott Kovatch CLA 2010-05-17 15:13:16 EDT
Commenting out the line s.flushDisabled() at Composite.java:557 fixes it, so we appear to be too aggressive with the flush deferral.
Comment 2 Scott Kovatch CLA 2010-05-17 15:13:48 EDT
This is a regression, so I think we should aim to fix it for RC2.
Comment 3 Silenio Quarti CLA 2010-05-18 10:03:34 EDT
Do we need a call to NSWindow.flushWindowIfNeeded() in Shell.clearDeferFlushing()?
Comment 4 Scott Kovatch CLA 2010-05-18 13:59:22 EDT
(In reply to comment #3)
> Do we need a call to NSWindow.flushWindowIfNeeded() in
> Shell.clearDeferFlushing()?

That does appear to fix the problem. I'm doing some more testing, but it looks good.
Comment 5 Scott Kovatch CLA 2010-05-18 14:29:29 EDT
Created attachment 168992 [details]
Fix

Call flushWindowIfNeeded instead of waiting for Cocoa to do it eventually.
Comment 6 Scott Kovatch CLA 2010-05-18 17:17:37 EDT
Fixed > 20100518.