<!--
{
  "availability" : [
    "macOS: 10.0.0 - 15.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindow/disableScreenUpdatesUntilFlush()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindow(im)disableScreenUpdatesUntilFlush"
  },
  "title" : "disableScreenUpdatesUntilFlush()"
}
-->

# disableScreenUpdatesUntilFlush()

Disables the window’s screen updates until the window is flushed.

```
func disableScreenUpdatesUntilFlush()
```

## Discussion

This method can be invoked to synchronize hardware surface flushes with the window’s flushes. The window immediately disables screen updates using the [`NSDisableScreenUpdates()`](/documentation/AppKit/NSDisableScreenUpdates()) function and reenables screen updates when the window flushes. Sending this message multiple times during a window update cycle has no effect.

To ensure that screen updates are reenabled in a timely manner, it’s crucial that the window is marked as needing display and that the display will occur soon (that is, within the next second). When you invoke `disableScreenUpdatesUntilFlush`, you can make sure that a marked window gets displayed by returning control to the run loop on the main thread or by sending the window [`displayIfNeeded()`](/documentation/AppKit/NSWindow/displayIfNeeded()) or [`display()`](/documentation/AppKit/NSWindow/display()). If it’s unclear whether the window is marked as needing display, you can also ensure that a display occurs by using [`setNeedsDisplay(_:)`](/documentation/AppKit/NSView/setNeedsDisplay(_:)) for a view that’s visible in the window.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)