Skip to content

Alt+Tab doesn't switch away from / minimize the app, and F11 windowed-mode toggle has no effect #270

Description

@dfattal

Reported by a partner integrator (Amazon Lab126 / LeiaViewer port, internal ticket UNITY-133). This was the 9th item in that report and was missed in the first triage sweep (#261–#268) — filing it now.

Symptom

In a running DisplayXR app:

  • Alt+Tab does not switch away from / minimize the app.
  • F11 does not toggle windowed mode.

Hypothesis (code-grounded, NOT yet confirmed on hardware)

The provider's weave window is created WS_EX_TOPMOST | WS_EX_NOACTIVATE and tracks Unity's window (native~/displayxr_win32.c ~1245-1265; WS_EX_NOACTIVATE is deliberate so the window never steals OS foreground and Unity's Raw Input keeps flowing). Nothing in that path appears to react to Unity's window losing foreground or being minimized.

If so, both symptoms are the same root cause: the weave window owns what is actually on the panel, and it stays TOPMOST and visible regardless of what happens to Unity's own HWND.

  • Alt+Tab moves foreground off Unity, but the topmost weave window keeps painting → looks like the app never switched away.
  • Screen.fullScreen (what F11 drives in Samples~/DefaultInputController/DisplayXRInputController.cs:434) toggles Unity's window mode, which the weave window does not follow → F11 appears to do nothing.

What would confirm it

  • Does the taskbar/Alt+Tab switcher actually change foreground (i.e. is it purely a visual stickiness), or is input still going to the app?
  • Does Screen.fullScreen report the flipped value while the panel output is unchanged?
  • Whether this reproduces with DISPLAYXR_PROV_EXTERNAL_WINDOW=1 and in the editor vs a built player.

Likely fix direction

Track the host window's state and mirror it on the weave window: hide/minimize it on WM_ACTIVATEAPP deactivate + SC_MINIMIZE, restore on activate, and follow Unity's windowed/fullscreen transitions. Needs care not to regress the deliberate WS_EX_NOACTIVATE foreground behavior or the #61 drag bracketing.

Note this is window policy, which the plugin has historically treated as app-owned (see the "window-chrome UI is app policy" principle) — but "the app cannot be Alt+Tabbed away from" is a platform-citizenship defect, not a policy choice, so it belongs in the plugin.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions