gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFA: [NSWindow -update] should not cause display


From: Alexander Malmberg
Subject: RFA: [NSWindow -update] should not cause display
Date: Sun, 16 Feb 2003 00:47:02 +0100

While fixing some issues in the text system (the insertion point
position and text view size wouldn't always update properly), I
discovered an issue with [NSWindow -update]. Currently, it redisplays
the window if needed, and this conflicted with the redisplay mechanism
based on -setNeedsDisplay: and -_handleWindowNeedsDisplay:. (Results
weren't incorrect, but there was a lot of annoying flashing since
drawing was done in two stages.)

The recent NSWindow docs clearly state that [NSWindow -update] sends
NSWindowDidUpdateNotification and does _nothing_ else (
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSWindow.html#BABBEJEE
). There's also a section about this at
http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/WinPanel/Concepts/HowWindowIsDisplayed.html
, and it's also very explicit that -display displays, and -update does
not.

However, the NSApplication docs for -updateWindows, which calls
[NSWindow -update], claims that it redisplays the window:
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSApplication.html#CACCGJID
(and that, if auto-display is disabled, it does nothing). The OpenStep
spec for NSWindow says that [NSWindow -update] redisplays the window and
sends the notification.

To me, the behavior documented in the current NSWindow docs seems to be
the best behavior (and I'm guessing that they've simply forgotten to
update the NSApplication docs). This gives us one (and only one)
mechanism for automatic displaying, and it works whenever a run loop is
running (so it works automatically for event tracking loops). It also
makes it possible to do late updating of things (by using
-performSelector:target:argument:order:modes: with an order lower than
the redisplay's 600000; this is what I was trying to do when I noticed
the issue). (I also suspect that this might be related to some of the
inefficient display problems.)

I would like to remove the display code from [NSWindow -update] to fix
this. [NSApplication -updateWindows] would also be changed to send
-update to all windows, not just the visible windows. Since this is a
somewhat tricky issue, I thought I'd bring it up for discussion first.
Comments are welcome. :)

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]