H.NotifyIcon icon indicating copy to clipboard operation
H.NotifyIcon copied to clipboard

Middle click not working with Windows 11 22H2 build 22621.1344

Open ptdev opened this issue 3 years ago • 7 comments

Describe the bug

After updating to Windows 11 build 22621.1344, the middle click event no longer appears to be working and seems to be triggering the regular left-click.

The original project by @hardcodet also has the same issue, so I'm assuming it's most likely some change in Windows itself.

This project that uses this library also appears to be suffering from the issue as reported here.

Reporting here although I'm not sure this will be fixable or if this feature was actually removed from Windows.

Steps to reproduce the bug

Update to Windows 11 build 22621.1344 Bind something to the tray icon's middle click event

Expected behavior

Should trigger the middle click message

Screenshots

No response

NuGet package version

Latest

Platform

WPF

IDE

Visual Studio 2022

Windows Version

Windows 11

WindowsAppSDK Version

No response

WindowsAppSDK Type

None

Manifest

No response

Additional context

No response

ptdev avatar Mar 13 '23 13:03 ptdev

Thank you for your message. I tried to find information about the changes in the documentation, but I don't see any changes: https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-mbuttonup https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-mbuttondown https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shell_notifyiconw I'll try adding WM_NCMBUTTONUP and WM_NCMBUTTONDOWN handling as a possible solution, but I'm not sure about that

HavenDV avatar Mar 13 '23 14:03 HavenDV

Hi, thanks for the quick reply.

I've also searched their docs and release documents and couldn't find any change that would fit this observed behavior, but nevertheless, the issue is present on both this library and the original one.

I've added some Debug statements to see what is getting triggered when middle clicking and all I'm getting is the left mouse press event.

Unfortunately I'm not too knowledgeable on these native windows calls/messages so not really sure how I could proceed with some fix or workaround.

I'm willing to test/validate any fixes you may release. Thanks again.

ptdev avatar Mar 13 '23 14:03 ptdev

Middle events still work in 22621.1265. I will try to update Windows to test

I have also released a test version with support for WM_NCMBUTTONUP and WM_NCMBUTTONDOWN. It will be great if you test it. The package will be uploaded to NuGet automatically in about 10 minutes https://github.com/HavenDV/H.NotifyIcon/commit/4a5c91324b20ab6ea9df4d5bac79a3468a3974fa

By the way, I also added a MiddleClickCommand

HavenDV avatar Mar 13 '23 14:03 HavenDV

I've updated to 22621.1344 and can confirm that any mouse Middle events are replaced with similar Left events. The window also doesn't receive any other events than this, so I don't see a workaround. I think we need to wait a few updates to make sure it's not a bug

HavenDV avatar Mar 13 '23 16:03 HavenDV

Thanks again for having a look at this and confirming its an actual issue.

It's a bit sad that this was removed without any further information or even being mentioned in the update's changelog.

I'm hoping this may eventually be fixed by Microsoft as I'm guessing there must be several applications that are using the middle click functionality and more people will probably start noticing this issue as they start updating their Windows.

Thanks again for the support. (Not sure if I should close this issue now or if you wish to keep it open, but feel free to close it as I'm guessing we're going to have to wait for some updates from MS for this to get solved)

Cheers

ptdev avatar Mar 13 '23 17:03 ptdev

Just to add some more detail about this to confirm that this is definitely a change in this windows version and not in anyway related with this lib or even wpf or winui.

Creating a blank winforms app in visual studio and using winforms own Notifyicon class and capturing the mouseclick event, always fires left click when clicking the middle mouse. While on previous windows versions it correctly identifies it as middle.

I have since reported it to microsoft on twitter and they dmd me basically letting me know that I should report it through the feedback hub app. I have reported there too and asked for some more clarification about it, if it was intended or not, if it's mentioned anywhere, etc. Not very hopeful but we'll see..

ptdev avatar Mar 14 '23 01:03 ptdev

Adding another update on this.

Microsoft has since released another Windows build (22621.1413) and unfortunately this issue is still present.

If anybody else is also hoping for this to be fixed, it may be worth upvoting or comment on the report I've filed through the Feedback Hub app.

You can see it here: https://aka.ms/AAk0sn4

Cheers, thanks.

ptdev avatar Mar 22 '23 12:03 ptdev