Bug 14954 - NSView redisplay doesn't update display when selection changes
Summary: NSView redisplay doesn't update display when selection changes
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2007-08-12 17:42 PDT by Nicholas Riley
Modified: 2008-03-06 03:51 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicholas Riley 2007-08-12 17:42:37 PDT
I'm trying to flash the selected text synchronously, but asking the NSView to redisplay doesn't draw anything after I change the selection.  This code works fine in released versions of Safari 2 (419.3).

WebHTMLView *view;
[...]
NSRect selectionRect = [view selectionRect];
for (i = 0 ; i < textBlinkCount ; i++) {
    [view deselectAll];
    [view setNeedsDisplayInRect: selectionRect];
    [view display];
    usleep(60000);
    [[view _bridge] selectNSRange: selectedRange];
    [view setNeedsDisplayInRect: selectionRect];
    [view display];
    usleep(60000);
}

I asked about this on #webkit and Darin suggested using [[view window] displayIfNeeded], which behaved identically to the above code (works in 419.3, not in nightly).
Comment 1 David Kilzer (:ddkilzer) 2007-08-12 21:15:01 PDT
<rdar://problem/5405513>
Comment 2 Nicholas Riley 2008-03-06 03:51:08 PST
I think this may have been a coding error on my part; whatever the issue was, it now works fine with Safari 3.0.4/3.1.