<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Scene/windowBackgroundDragBehavior(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI5ScenePAAE28windowBackgroundDragBehavioryQrAA017WindowInteractionG0VF"
  },
  "title" : "windowBackgroundDragBehavior(_:)"
}
-->

# windowBackgroundDragBehavior(_:)

Configures the behavior of dragging a window by its background.

```
nonisolated func windowBackgroundDragBehavior(_ behavior: WindowInteractionBehavior) -> some Scene
```

## Parameters

`behavior`

The behavior of dragging the modified window by its
background.

## Return Value

A scene configured with the specified behavior of dragging it
by its background background.

## Discussion

By default, or when you apply the [`automatic`](/documentation/SwiftUI/WindowInteractionBehavior/automatic)
behavior, the system will determine the best suitable behavior based on
the configuration of the modified scene.

You can use this modifier to override the default behavior. For example,
to always enable dragging a window by its background:

```
struct MyApp: App {
    var body: some Scene {
        Window("About MyApp", id: "about") {
            AboutView()
        }
        .windowBackgroundDragBehavior(.enabled)
    }
}
```

If you want to let your users drag your window by a specific view
instead of (or in addition to) letting them drag it by its background,
use [`WindowDragGesture`](/documentation/SwiftUI/WindowDragGesture).

Applying the [`enabled`](/documentation/SwiftUI/WindowInteractionBehavior/enabled) behavior is
equivalent to adding a [`WindowDragGesture`](/documentation/SwiftUI/WindowDragGesture) to the window’s background
view.

---

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)