dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.08k stars 1.17k forks source link

Button renders wrong after mouse leave #707

Closed jorisvergeer closed 5 years ago

jorisvergeer commented 5 years ago
arpitmathur commented 5 years ago

Closing this issue since this is externally caused.

jorisvergeer commented 5 years ago

I don't agree that much. External software might be triggering this, but if WPF core is the only library that has issues, then there is something ~wrong~ different with WPF core.

I sure as heck won't adopt WPF core in production applications knowing that it glitches with at least 2 different pieces of software that comes with fresh PC's.

fatihyildizhan commented 4 years ago

2299 This happened to me with .Net Core 3.1 WPF application. I am not using Nahimic and Realtek. I couldn't fix it so, I created a project with .Net Framework 4.8 WPF application and the problem goes away.

sunmachine commented 4 years ago

Chiming in - still happening as of dotnet core 3.1.100.

asm541 commented 4 years ago

borderless window(allow transparency) fixing the issue;

can implement move ,minimize maximize, close window functionalities instead of default window, it can create very attractive designs :) title

sunmachine commented 4 years ago

It's a shame I can't get the default window behaviour to work, though. For now, since I'm just working with toys, this is fine. Thank you @zamoldar .

fatihyildizhan commented 4 years ago

I started to a new production project with .Net Core 3.1 because it has LTS support then I had to switch the .NET Framework due to this UI problem.

jorisvergeer commented 4 years ago

I can conform that my problems (which I still have) are going away when I set the WindowStyle to "None" and AllowsTransparency to "True"

as mentioned by @zamoldar

ghost commented 4 years ago

We've seen users with this issue in our application and we're using .NET Framework, so the bug is not exclusive to .NET Core

pcfulife commented 4 years ago

Nahimic was updated to v1.4.1.0 which fixes this bug! yeah!

rladuca commented 4 years ago

@pcfulife Thanks so much for updating this issue, that's great!

Out of curiosity, did you see any release notes for the update? My short searching for them wasn't successful. I'd just like to see if they explicitly mention this issue just in case they only accidentally fixed it. I wouldn't want the behavior to break again by happenstance. I'll keep looking later on, but if you happened to have them handy (or even one of there installers that shows the notes) that would be helpful!

pcfulife commented 4 years ago

@rladuca I found release note at Microsoft Store.

What's new on Nahimic 1.4.1?

  • Fix on software compatibility, incl. League of Legends fix
  • New supported models

There is no explict mention of WPF. But, they said that some compatibility issue was fixed.

rladuca commented 4 years ago

@pcfulife Thanks for taking a look! A little more vague than I would like unfortunately. I'll see if we can get more details out of this.

jorisvergeer commented 4 years ago

@pcfulife I saw that there inded were updates for the drivers. Unfortnately, those updates were not installed automatically. I had to go to drivers and updated them under "software components" manually.

At first glance, some of the applications that had glitches look OK now. (At least in the first minute of usage)

benjamincoven commented 4 years ago

Hello everyone,

I have the same problem, but I didn't find any nahimic driver on my computer. Is there anyway to check if nahimic is installed and which version? If Nahimic is not installed onmy computer, should I open another issue? Note that I found some scenarios in my app when the problem happens and some it does not on the same controls.

realflight1 commented 4 years ago

For anyone with ASUS ROG machines, the Sonic Suite application that comes with the system causes this issue (I assume it uses Nahimic internally).

rocuh commented 4 years ago

I agree with Microsofts approach as this overlay software is basically malware in my eyes and causes problems with a lot of apps. But it is quite widespread unforunately and only the latest releases of their software will have the .net core detection fixes in, so I've found a couple of workarounds.

One is to inspect the modules at startup (Process.GetCurrentProcess().Modules) and if a module named "NahimicOSD.dll" is there it will downgrade to software rendering (RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly). At least the app will run without corruption and on other PCs you will still get acceleration.

The second method which keeps the hardware accleration is to put a d3d9.dll proxy in your application directory, this seems to stop the overlay injectors. I took this one https://github.com/maltsevda/FakeD3D9 and removed the adjustments specific for that use case and made it a straight proxy https://github.com/roceh/FakeD3D9 . It seems to stop Nahimic/Sonic Suite that gets installed with my realtek audio drivers for my motherboard (ASUS ROG 370F).

sirJimmy1 commented 3 years ago

Hi, still happening in .net5. Just migrate my wpf app from .Net framework 4.6 where it was working fine and discovered this issue.

weltkante commented 3 years ago

@sirJimmy1 note that the behavior was not caused by WPF, but by faulty 3rd party software injecting itself incorrectly into the .NET Core program. Updating to .NET 5 will likely not change how the 3rd party software behaves.

sirJimmy1 commented 3 years ago

@weltkante my bad.... I am blind. Thank you. Updating Nahimic now so will see if it will fix it.

konradsikorski commented 3 years ago

i have the same problem described in #4141 Today was trying to find the app responsible for this and found it. In my case it was "Asus Rog Phoebus Sonic studio v1.1.14". After killing it from system try the problem is gone now.

Squall-Leonhart commented 3 years ago

Recent Windows updates have reintroduced the issue being experienced here, the workaround/fix that Nahimic had implemented has been broken by it.

I first thought it was due to a recently pushed armory crate update by Asus but force installing the older version doesn't resolve the issue.

HitEmUp commented 3 years ago

Same issue, all buttons like the Visual Studio Installer (bottom right) have this problem after hovering. I tried update my Nvidia drivers... windows 10 is up to date. Windows10-ButtonBug

jorisvergeer commented 3 years ago

@HitEmUp Like everyone else here. It is probably caused by some crapware that came with your sound drivers that likes to inject itself into various applications not on it's blacklist that make use of DirectX for drawing. Probably for some 3d spatial aware sound effect or something, or for injecting an overlay of some sort. (Guess what, all new releases of dotnet core are probably not prematurely listed in its blacklist)

HitEmUp commented 3 years ago

@jorisvergeer thx for your hint, i did check some applications for overlays and turn everything off i found. But still no fix, do u mean i need to update my sound drivers? What did help you to fix it? It's windows wide, means, its everywhere (WPF / UWP Apps), .Net 5 . Net 4.8, Core .Net 3.1... doesn't matter. Looks like a Windows wide bug to me.

HitEmUp commented 3 years ago

@jorisvergeer @stevenbrix my best guess here is that Nahimic has an overlay that they can render. When they do their overlay rendering, they probably change the viewport to cover the entire swapchain, and don't change it back to what the application had set. Then when WPF goes to render, it assumes that the viewport is still what it was last time, and if the only thing that changed was the same thing that changed last time, then it doesn't try to update the viewport. If Nahimic was involved, then it ends up rendering something that was supposed to be a sub-rect into the entire swapchain.

In this case, they're not drawing their overlay... but they're still changing the viewport it seems. This is more or less a guess, but it fits the symptoms and wouldn't surprise me.

Nvm. it was NahimicService!!! Turned it off, nice, thanks guys.

Squall-Leonhart commented 3 years ago

@jorisvergeer the software might be crapware, but it was previously not causing this prior to recent windows 10 cumulative updates unless a severely out dated version was installed.

Like mentioned in other posts here Nahimic did introduce measures to prevent it from causing this, and these measures have been rendered ineffective as a result of some change in the OS.

Daniel15 commented 3 years ago

I just encountered this problem too. I can't believe that two years later, this garbage Nahimic stuff still has the same issue.

I read online that the Nahimic Service comes with something called "Sonic Suite", which was apparently bundled with the sound drivers for my motherboard. I uninstalled that as well as some other Sonic thing, but they left the Nahimic Service in place. I couldn't figure out how to properly uninstall the service so I first disabled it and then deleted the C:\Windows\system32\NahimicService.exe file (protip: good, well-written apps don't just drop their executables into system32). I'm worried a driver update will bring it back, in which case I'll just put a dummy EXE there and change the permissions so that nobody other than some random user account on my PC can write to the file.

Why are drivers bundled with so much junk these days? I miss the days when they were just an .inf file and a few .cat and .sys and/or .vxd files, with no randomly bundled executables.

zyo2012 commented 3 years ago

I know this topic is old but on a brand new computer on windows 10 I was getting that issue and it was cause by the Asus Motherboard tools. I've uninstall everything that had the word "Asus" and that fixed my "mouse over" problem.

Xinnony commented 3 years ago

Same here for all WPF program, i uninstall all Sonic app (ASUS), and work perfectly after reboot (NahimicService is run).

anose001 commented 3 years ago

Very helpful thread. I ran into the same problem. Removing Realtek software (don't have any Nahimic) and the Realtek audio driver plus a restart helped. Buttons render fine, however the Realtek audio driver installs itself again (and rendering of buttons still keeps working) until I restart my PC again and this is when the rendering fails and falls back to its old behavior. Any suggestions on how to proceed from here on?

jorisvergeer commented 3 years ago

@anose001

Very helpful thread. I ran into the same problem. Removing Realtek software (don't have any Nahimic) and the Realtek audio driver plus a restart helped. Buttons render fine, however the Realtek audio driver installs itself again (and rendering of buttons still keeps working) until I restart my PC again and this is when the rendering fails and falls back to its old behavior. Any suggestions on how to proceed from here on?

If you are the developer you could try the suggestion in this post https://github.com/dotnet/wpf/issues/707#issuecomment-654412749

anose001 commented 3 years ago

Thanks! The first suggestion worked and I was able to confirm that Nahimic loads into the modules that startup. Although I would like to try the second one as well but was not able to find a dll file. Do I need to compile it after downloading the github repo?

Also, this is a little strange, but for over a year everything was perfectly fine and then all of a sudden this started occurring. I am wondering whether the audio driver update or anything... that would be quite unfortunate.

walterlv commented 3 years ago

I collected the modules of a broken WPF app, and find three unexpected modules:

  1. C:\ProgramData\A-Volute\DellInk.AlienwareSoundCenter\Modules\ScheduledModules\DellInc.AlienwareSoundCenterDevProps2.dll
  2. C:\ProgramData\A-Volute\DellInk.AlienwareSoundCenter\Modules\ScheduledModules\NahimicOSD.dll
  3. C:\ProgramData\A-Volute\DellInk.AlienwareSoundCenter\Modules\ScheduledModules\ProductInfo.dll

Yes! It's the NahimicOSD.dll that is mentioned by most of you, and the AlienwareSoundCenter does this!

image


UPDATE:

Other possible paths:

The last one is not from Dell's device:

I've written a post to talk about this.

anose001 commented 3 years ago

@walterlv, are you suggesting to remove those?

walterlv commented 3 years ago

@anose001 Yes.

I've removed the ScheduledModules folder and everything goes back to fine.

But I'm still determining a better solution for our software.

anose001 commented 3 years ago

@walterlv , that worked. Curious to see what comes out and learn more. Thanks and cheers

TrashcanCoder commented 3 years ago

Deleting C:\ProgramData\AWHeadset\DellInc.AlienwareSoundCenter\Modules\ScheduledModules\NahimicOSD.dll solved the Problem that are some Buttons rendered incorrectly after clicking (Wpf 4.7.2), see first posts. (I had to kill some Processes that blocked the removal of the .dll)

Workaround in my Application (No more neccesary): System.Windows.Media.RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;

No Luck: Reinstall Windows because AlienwareSoundCenter was installed automatically after plug in Headset.

walterlv commented 3 years ago

@TrashcanCoder If you don't want to find and kill the processes, you can try to rename the dll.

gmgunderground commented 3 years ago

Hi, same problem on my Alienware Area 51m R2 Renaming NahimicOSD.dll no more problems, but what is the purpose of injecting NahimicOSD ?

walterlv commented 3 years ago

Hi, same problem on my Alienware Area 51m R2

Renaming NahimicOSD.dll no more problems, but what is the purpose of injecting NahimicOSD ?

NahimicOSD is an on-screen display library that displays something on any software using DirectX as its rendering engine. Unfortunately, the additional rendering blooms the rendering of WPF apps (DirectX 9 application precisely).

You can see more details in my post and the DELL community:

TrashcanCoder commented 2 years ago

Updated to Win11

Same Error again: Deleting NahimicOSD.dll did not work; Some processes accesses the file (Unable to kill). C:\ProgramData\AWHeadset\DellInc.AlienwareSoundCenter\Modules\ScheduledModules\x64\NahimicOSD.dll

But with file -> Properties -> Security: Deny all access works perfect.

rephiled commented 2 years ago

I have this issue on a new Alienware Aurora 13 I cant find anything like Nahimic on it and I don't have any computer skill what can I do

Squall-Leonhart commented 2 years ago

Nahimic is on several alienware machines,

https://www.reddit.com/r/MSI_Gaming/comments/l45fnj/guide_how_to_uninstall_nahimic_completely_from/

rephiled commented 2 years ago

Nahimic is on several alienware machines,

https://www.reddit.com/r/MSI_Gaming/comments/l45fnj/guide_how_to_uninstall_nahimic_completely_from/ Thanks for this

oli-g-sk commented 2 years ago

I have this issue on a new Alienware Aurora 13 I cant find anything like Nahimic on it and I don't have any computer skill what can I do

  1. Open Start and search for Services
  2. Look for the Nahimic service, right click and choose Properties
  3. Set its Startup Type to Disabled
  4. Restart

🖼️ Screenshots

  1. https://ibb.co/S32LbVm
  2. https://ibb.co/DtGwSY7
  3. https://ibb.co/sjPtKJ2
Squall-Leonhart commented 2 years ago

This is reportedly resolved with standalone nahimic 1.8.6, and vendor softwares including it.