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

Windows 10 1903 Window Drag Issue #42

Open
HEIC-to-JPEG-Dev opened this issue Apr 20, 2019 · 47 comments
Open

Windows 10 1903 Window Drag Issue #42

HEIC-to-JPEG-Dev opened this issue Apr 20, 2019 · 47 comments
Milestone

Comments

@HEIC-to-JPEG-Dev
Copy link

Hi, I just upgraded to Windows 10 1903 and noticed that using the titlebar to drag a window has a very high latency, lagging behind the cursor movements by seconds.

I'm using the AcrylicWindow with ExtendViewIntoTitleBar="True"

Thanks for any updates.

@Andrei-Lapusteanu
Copy link

Experiencing the same issue on my 1903 build, could not yet figure out a solution.

@vivaladan
Copy link

I've only just discovered FluentWPF but have hit this issue right away on 1903 with a super simple new app.

@sourcechord
Copy link
Owner

Hi, @DHitchenUK
Sorry for replying so late.
Thanks for the information.
I recognized your reporting issue.
I'm inspecting the behavior of FluentWPF in Windows10 19H1, and trying to fix it.
Please wait for a while.

@HEIC-to-JPEG-Dev
Copy link
Author

@sourcechord, I just wanted to say thanks for the work you put in, it's very much appreciated.

@dsafa
Copy link

dsafa commented May 15, 2019

If you turn off transparency effects in the settings, it works like before. Of course this turns off blur for all windows apps however.

@sourcechord
Copy link
Owner

Hi, @DHitchenUK
Maybe, it is same as riverar/sample-win32-acrylicblur#2

FluentWPF uses undocumented Win32API(SetWindowCompositionAttribute method).

The reported behavior is caused by the change in the behavior of that API.
It seems that SetWindowCompositionAttribute API is broken in Windows10 1903.

Dragging problem occurs Windows10's emoji toolbar, too.
(that is shown by Win+period key)
And, these problem is reported in Feedback Hub.
https://aka.ms/AA4pzyf
https://aka.ms/AA4fmz7

Please upvote it 🙏

@ashelleyPurdue
Copy link

ashelleyPurdue commented Jun 10, 2019

I'm still getting this issue even after updating to FluentWPF 0.7.0.

EDIT: Actually, this is strange. The issue doesn't occur on my work computer, but does still occur on my home computer. I'll try it again on my home computer to see if I did something wrong.

@ghost1372
Copy link

This bug seems to be fixed in version 1903 (18362.267)

@0xCA
Copy link

0xCA commented Sep 9, 2019

This bug seems to be fixed in version 1903 (18362.267)

18362.295, still here

@JVimes
Copy link

JVimes commented Oct 7, 2019

Is this supposed to be open? 637ea17 did not fix it for me (Windows 1903, OS build 18995.1)

@Armin2208
Copy link

In 1909, or a new cumulative update, the problems are again present.

@sourcechord
Copy link
Owner

Hi, @Armin2208

Thanks for the information.
I fixed it in FluentWPF v0.8.0-alpha004
Please try it.

@Armin2208
Copy link

I've tried it and it works. Nice, thank you!

@sourcechord
Copy link
Owner

I'm glad to hear that.
I'll close this issue.
If you have any problems, please reopen this issue.

shemanaev added a commit to shemanaev/RepoZ that referenced this issue Jan 31, 2020
awaescher pushed a commit to awaescher/RepoZ that referenced this issue Feb 1, 2020
@NickAcPT
Copy link

NickAcPT commented Apr 8, 2020

I know that this issue has been closed already, but is there a way to keep the real acrylic blur and not have these issues?

For example, I've seen DevExpress avoid this issue by temporarily disabling the transparency when moving the window, showing the Fallback colour.

@tricky-mind
Copy link

@sourcechord , I actually know how to recreate the acrylic effect of uwp using interop(not the setWindowComposition() method but using the direct x)

But have the same issue. But only on resizing and not on dragging

Preview

This is totally different from your code.

@not-nullptr
Copy link

It is also worth mentioning that dragging the window on the desktop does not lag at all.

@sourcechord
Copy link
Owner

Hi @NotARobot6969

This is the intended behavior.
There are two types of blur effect;

  • ACCENT_ENABLE_ACRYLICBLURBEHIND: Hard blur that is same as UWP's acrylic effect
  • ACCENT_ENABLE_BLURBEHIND: Soft blur

ACCENT_ENABLE_ACRYLICBLURBEHIND effect causes laggy behavior during window is moving or resizing. So that, FluentWPF applies ACCENT_ENABLE_ACRYLICBLURBEHIND effect only when the window is stabled, and applies ACCENT_ENABLE_BLURBEHIND effect during window is moving or resizing.

@not-nullptr
Copy link

@sourcechord But then there is no blur for most of the time, at least for me.

@not-nullptr
Copy link

To clarify: For me, the laggy effect is applying when I move the window, and no effect is being applied when it's stationary.

@sourcechord
Copy link
Owner

According to the uploaded movie, the background of the window doesn't seems to have enough texture. It is difficult to recognize the blur effect.
Could you show the window on a more complex background images?

@not-nullptr
Copy link

@sourcechord
Copy link
Owner

Please tell me your environment.
Your window has rounded border. Are you using windows11 insider preview?
I've not tested FluentWPF 0.10.0-alpha001 in windows11 yet 😓

@not-nullptr
Copy link

Indeed! I forgot to mention it.

@not-nullptr
Copy link

@sourcechord I forgot to tell you this too; the less windows behind the acrylic program, the less lag there is.

Desktop with no windows behind (smooth):
https://user-images.githubusercontent.com/62841684/124514339-b8e8c580-ddd4-11eb-873b-fc2f42053f53.mp4

Many windows behind (laggy):
https://user-images.githubusercontent.com/62841684/124514438-ecc3eb00-ddd4-11eb-98df-03fc8d108521.mp4

@Simnico99
Copy link

Seems to be a Windows 11 related issues as I am experiencing the same thing on Windows 11 Version 22000.51:

18ab2e6be93ef481aac39f1269afd949

@alexmercerind
Copy link

alexmercerind commented Aug 3, 2021

Seems to be a Windows 11 related issues as I am experiencing the same thing on Windows 11 Version 22000.51

Latest build of Windows 11 22000.100, acrylic has stopped working. 😭
C'mon Microsoft.

@sourcechord
Copy link
Owner

I'm checking the window behavior with FluentWPF in Windows11 environment. But, currently there is no way to apply aclylic effect with SetWindowCompositionAttribute API.
So that I turnd off acrylic effect in FluentWPF 0.10.0-alpha002(only in Windows11 env).

It's a tough situation; however I'll continue to survey to provide 'Fluent Design' in windows11 environment.

@selastingeorge
Copy link

@sourcechord i am working on a workaround using direct composition, a sample win32 demo is available here : Acrylic Effect using DWM and Direct Composition. I am trying to build a wpf version, its a bit hard.

@alexmercerind
Copy link

@Extrimis I also tried to use similar approach but with XAML islands instead.
And those widgets always overlap the existing widgets. Can't figure out.

@selastingeorge
Copy link

@Extrimis I also tried to use similar approach but with XAML islands instead.
And those widgets always overlap the existing widgets. Can't figure out.

Create Separate window and attach both windows together with SetWindowPos(), instead of Resizing Both Windows, Resize the Windows.UI.Composition.Visual so there wont be any flickering on resize. The acrylic window should be WS_EX_TRANSPARENT,WS_EX_LAYERED

@selastingeorge
Copy link

@Extrimis I also tried to use similar approach but with XAML islands instead.
And those widgets always overlap the existing widgets. Can't figure out.

Create Separate window and attach both windows together with SetWindowPos(), instead of Resizing Both Windows, Resize the Windows.UI.Composition.Visual so there wont be any flickering on resize. The acrylic window should be WS_EX_TRANSPARENT,WS_EX_LAYERED

I am looking forward to mica than acrylic.

@sourcechord
Copy link
Owner

Hi, @Extrimis
Thanks for the information, it was very interesting. But it seems hard to implement in WPF.

I am looking forward to mica than acrylic.

I think so too. I'd like to introduce mica materials in FluentWPF, but haven't found a way to achieve it.

BTW FluentWPF currently has some problems in Windows11 that need to be fixed. So that, I created another GitHub issue(#130) to track it.
Please let me know about Windows 11 problems and acrylic effects in above issue.

@selastingeorge
Copy link

My laptop won't support windows 11 otherwise I would have checked it.

@selastingeorge
Copy link

Have you tried windows.ui.composition interop method for acrylic, that one won't lag but it has airspace issues that must be solved, it's the real acrylic

@sourcechord
Copy link
Owner

No, I heven't tried yet. Because it seems that Composition API doesn't support interop with WPF window.
I read following article, but there are only CompositionHostControl way, and no explanation for interop with WPF window.
https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/using-the-visual-layer-with-wpf

@selastingeorge
Copy link

you don't need a compositionHostControl to do that,you can directly render those things into wpf window,but the only issue is the airspace issue,and the only way i see to solve the issue is by overlapping windows

@selastingeorge
Copy link

No, I heven't tried yet. Because it seems that Composition API doesn't support interop with WPF window.
I read following article, but there are only CompositionHostControl way, and no explanation for interop with WPF window.
https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/using-the-visual-layer-with-wpf

Check out the microsoft repo : WPF AcrylicEffect Sample

@sourcechord
Copy link
Owner

OIC 😃
I tried WPF AcrylicEffect Sample, and recognized that can draw to window directly. But it has airspace issue as you said.
If we use Windows.UI.Composition, we have to create separete window for avoiding airspace issue.

It is difficult to implement, and causes the increase of complexity.
So that, I'll release FluentWPF 0.10.0 with SetWindowCompositionAttribute way, however continue to investigate real acrylic effect.

@selastingeorge
Copy link

selastingeorge commented Aug 11, 2021 via email

@gen3vra
Copy link

gen3vra commented Mar 24, 2022

has anyone else observed the behavior that in visual studio 2022 the drag is fine in debug mode?

in my application which makes use of SetWindowCompositionAttribute() I've observed the following strange behavior:
In visual studio 2022 debug mode Acrylic blur windows seem to function as originally intended.
Additionally, attaching the visual studio 2022 debugger to the built application makes the faulty build work for as long as the debugger is attached.
This behavior persisted in both Net 6 and Net core 3.1, and Visual Studio 2019 did not “fix” the application as the video shows 2022 did.
Video of behavior:
https://streamable.com/recib9
(ShareX basically gives up recording the laggy drag movement bug)
Can anyone let me know if they’re also seeing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests