microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

"transparency effects" option (on-by-default) breaks flyout backgrounds in self-contained apps running from MSIX if they're in a subdirectory

Open fredemmott opened this issue 2 years ago • 7 comments

Describe the bug

Flyout backgrounds (e.g. command bar menus, app bar command flyouts) are fully transparent if this windows option is enabled.

If I extract the MSIX and run the exe directly, they are rendered correctly

Uninstalling all windows app runtime packages does not solve the problem

Steps to reproduce the bug

  1. Install https://github.com/OpenKneeboard/OpenKneeboard/releases/tag/v1.1-beta3 (self contained, windows app sdk 1.1)
  2. run app
  3. click '...' in title bar or settings -> tabs -> add tab
  4. see flyout with broken background rendering
  5. close application
  6. unpack msix with makeappx
  7. run OpenKneeboardApp.exe directly
  8. repeat step 3
  9. see proper rendering
  10. turn off 'transparency effects' in windows 10
  11. re-run installed app
  12. repeat step 3
  13. see proper rendering

Expected behavior

flyouts should be rendered with an opaque or semi-opaque background, not full transparency

Screenshots

Buggy

image

image

Good

image

image

Windows 10 setting

image

NuGet package version

WinUI 3 - Windows App SDK 1.1.1

Windows app type

  • [ ] UWP
  • [X] Win32

Device form factor

Desktop

Windows version

Windows 10 (21H2): Build 19044

Additional context

Can reliably reproduce on my main machine, with an nvidia 3090ti. Can not reproduce in a clean windows 10 installation in hyperv on the same machine, or on a surface pro 3, also running windows 10.

fredemmott avatar Jun 27 '22 04:06 fredemmott

Yeah, this is the switch to self-contained deployment:

https://github.com/OpenKneeboard/OpenKneeboard/actions/runs/2471122272 works fine https://github.com/OpenKneeboard/OpenKneeboard/actions/runs/2471247977 does not

https://github.com/OpenKneeboard/OpenKneeboard/commit/82edd61595d87a3503a6f08ea80bb1bee4f97b52 is the only difference, switching to self-contained

This also only reproduces if actually installed from msix - add-appxpackage -register appxmanifest.xml doesn't reproduce the problem

fredemmott avatar Jun 27 '22 04:06 fredemmott

also reproduces on a friend's machine with no developer tools, no previous installations of window app runtime/winui3 etc, on windows 11 21H2 22000.739 - also with nvidia graphics card

fredemmott avatar Jun 27 '22 04:06 fredemmott

Still repros with v1.1.4 - https://github.com/OpenKneeboard/OpenKneeboard/actions/runs/3015667140

fredemmott avatar Sep 08 '22 15:09 fredemmott

Does Microsoft.UI.Xaml\Assets\NoiseAsset_256x256_PNG.png exist in the problematic installs? I think the fully-transparent effect you're seeing could happen if this file can't be found and loaded for the AcrylicBrush effect.

codendone avatar Sep 08 '22 19:09 codendone

yep, this is present, though with a bin\ prefix next to my executable, not in MSIX_ROOT\Microsoft.UI.Xaml

image

In case it's useful https://github.com/OpenKneeboard/OpenKneeboard/suites/8196217381/artifacts/356836033 is the extracted MSIX , and https://github.com/OpenKneeboard/OpenKneeboard/suites/8196217381/artifacts/356836034 is the MSIX itself

fredemmott avatar Sep 08 '22 19:09 fredemmott

@codendone thanks for the pointer :)

I changed my app to put the binaries in $MSIX_ROOT instead of $MSIX_ROOT/bin - and, in turn, msbuild or the windows app sdk automatically made $MSIX_ROOT/Microsoft.UI.Xaml/ instead of $MSIX_ROOT/bin/Microsoft.UI.Xaml, and it all works there.

Leaving this open as this should probably work either way, and the add-appxpackage -register behavior should match the real MSIX behavior

fredemmott avatar Sep 10 '22 01:09 fredemmott

Thanks for the update, @fredemmott. I'm glad you found a solution!

codendone avatar Sep 13 '22 02:09 codendone