Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DragUI.SetContentFromSoftwareBitmap() does not show the bitmap #4528

Closed
wbokkers opened this issue Mar 12, 2021 · 9 comments
Closed

DragUI.SetContentFromSoftwareBitmap() does not show the bitmap #4528

wbokkers opened this issue Mar 12, 2021 · 9 comments
Labels
appModel-win32 Exclusive to WinUI 3 Win32 Desktop apps area-Images Images, SVG needs-triage Issue needs to be triaged by the area owners product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team

Comments

@wbokkers
Copy link

When setting the drag bitmap in the DragStarting event handler, the bitmap is not displayed.
To set the bitmap, I use args.DragUI.SetContentFromSoftwareBitmap(...)

Steps to reproduce the bug

  1. Add an event handler to a DragStarting event
  2. Create a software bitmap
  3. Set the bitmap using DragUI.SetContentFromSoftwareBitmap()
  4. The bitmap does not show up.

Expected behavior
The bitmap should be visible

Version Info

NuGet package version:
Microsoft.ProjectReunion 0.5.0-prerelease

Windows 10 version Saw the problem?
May 2020 Update (19041) Yes
@andrewleader andrewleader transferred this issue from microsoft/WindowsAppSDK Mar 15, 2021
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Mar 15, 2021
@jschwizer99
Copy link

I observe the same problem with args.DragUI().SetContentFromBitmapImage(bitmap). I also do not see the image. When just calling args.DragUI() a paper sheet is shown.

@jschwizer99
Copy link

This issue could be related to #4545 as I indeed see the bitmap icon if #4545 works on a platform reliable.

@codendone
Copy link
Contributor

I believe @jschwizer99 is correct that this is the same as #4545. The comment I just added to that one:

We just debugged this issue last week. This is unfortunately a bug in Windows specific to non-UWP apps. It isn't clear right now if we can fix this in WinUI3. On the plus side, this has been fixed in Windows, and is available in current Dev Channel builds from the Windows Insider Program.

In theory it is possible to avoid the issue if you can avoid any awaits (and taking a deferral) in your DragStarting handler. But that likely isn't reasonable for most uses to already have the bitmap ready.

@wbokkers
Copy link
Author

@codendone Will the window fix also be applied to older Windows versions? WinUI Desktop is supposed to work on older Windows versions as well.

@StephenLPeters StephenLPeters added appModel-win32 Exclusive to WinUI 3 Win32 Desktop apps area-Images Images, SVG team-Rendering Issue for the Rendering team product-winui3 WinUI 3 issues labels Mar 19, 2021
@codendone
Copy link
Contributor

codendone commented Mar 19, 2021

Backporting will be considered, but I can't guess whether it will be approved, or how far it might be backported.

@wbokkers
Copy link
Author

ProjectReunion 0.8.0-preview regresses even more. Even the default drag UI bitmap never shows up. This was working 1 out of 5 times in Reunion 0.5.7. Overriding the bitmap still does not work.

And I still get random crashes while dragging: 0xC000027B: An application-internal exception has occurred

@codendone
Copy link
Contributor

The OS fix for this issue went live on Windows Update over the last month, so fully updated machines should no longer experience this issue.

@ghost ghost removed the needs-triage Issue needs to be triaged by the area owners label Sep 2, 2021
@sudongg
Copy link

sudongg commented Jun 25, 2022

The problem is easily triggered when I use StartDragAsync .
I'm confused by "This is unfortunately a bug in Windows specific to non-UWP apps" because I don't have this problem on other UI frameworks (like Google Chrome)
I would like to know if there is any workaround for this issue currently in older versions?

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jun 25, 2022
@bpulliam bpulliam removed the needs-triage Issue needs to be triaged by the area owners label Mar 13, 2023
@stevenbrix
Copy link
Contributor

@codendone this seems to still be happening on windows 11 so it seems that the OS fix from a few years ago wasn't enough?

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appModel-win32 Exclusive to WinUI 3 Win32 Desktop apps area-Images Images, SVG needs-triage Issue needs to be triaged by the area owners product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team
Projects
None yet
Development

No branches or pull requests

7 participants