# DesktopBeast™ Window Focus Z-Order Green

Milestone: DESKTOPBEAST_WINDOW_FOCUS_ZORDER_GREEN

## Observed

When only the Capture Screen was visible, clicking `DTB Main Screen` restored DesktopBeast™ Main Screen but left it underneath the Capture Screen. Taskbar previews showed both windows, but Main Screen could not reliably come forward.

## Cause

The Capture Screen was created with:

```csharp
Owner = this
```

In WPF, an owned window stays above its owner. That made the Capture Screen behave like a dialog even though it is a primary workflow window. Restoring/activating MainWindow could not reliably place it above its owned Capture Screen.

## Changed

- Removed MainWindow ownership from the Capture Screen.
- Capture Screen remains maximized but is now a peer workflow window.
- Added `ShowMainWindowFromAnyContext(bool closeCompletionWindow)` as the shared foreground helper.
- Routed Capture Screen `DTB Main Screen` through the helper.
- Routed tray `Open DesktopBeast™` and tray double-click through the helper.
- Helper behavior:
  - optionally closes the Capture Screen when opened from `DTB Main Screen`
  - minimizes Capture Screen when opened from tray
  - shows MainWindow
  - maximizes MainWindow
  - briefly toggles Topmost to bring MainWindow forward
  - calls `Activate()`
  - calls `Focus()`
- CompletionWindow `Closed` now clears the cached reference.

## Package

- ZIP: `release/DesktopBeast-EA-Beta-Package-Candidate.zip`
- SHA256: `87E01AD993F30B6C5C2F88559E2049334F12BCFB692CE57D452715D5DA63CC65`

## Verified

- Build succeeded.
- Publish succeeded.
- Package ZIP regenerated.
- Checksum regenerated.
- PDB/debug symbol excluded from package.

## Manual Validation Needed

- Open Capture Screen.
- Click `DTB Main Screen`.
- Confirm Main Screen opens/restores/maximizes in foreground.
- Confirm Capture Screen does not trap Main Screen underneath.
- Confirm taskbar previews can bring either window forward normally.
- Confirm tray `Open DesktopBeast™` uses the same foreground behavior.

## Scope Confirmation

- No Cloudflare DNS touched.
- No live deployment performed.
- No BrowserBeast™ paid/pro work started.
- No PersonaVault work started.

