uno icon indicating copy to clipboard operation
uno copied to clipboard

Mouse wheel input is unreliable in multiwindow

Open MartinZikmund opened this issue 1 year ago • 13 comments

@MartinZikmund If you are going to look into multiwindow issue please also check the mouse wheel event on the second monitor. What I saw when testing the Mapsui issue is that on the second monitor the mouse wheel event only fired on the top left of the screen (about 1/16th of the total surface).

Originally posted by @pauldendulk in https://github.com/unoplatform/uno/issues/15601#issuecomment-1963677445

MartinZikmund avatar Feb 26 '24 09:02 MartinZikmund

@pauldendulk was this on WPF or GTK?

MartinZikmund avatar Feb 26 '24 09:02 MartinZikmund

We use the SKXamlCanvas (is that WPF?).

pauldendulk avatar Feb 26 '24 11:02 pauldendulk

I meant which Uno Platform target you are experiencing issues on (YourApp.Skia Wpf/YourApp.Skia Gtk/something else?)

MartinZikmund avatar Feb 26 '24 13:02 MartinZikmund

I was running Mapsui.Samples.Uno.WinUI.Windows on Windows, this one.

pauldendulk avatar Feb 26 '24 13:02 pauldendulk

Oh, that seems like a WinUI bug then (Uno Platform does not "exist" on Windows target) - I think the issue will need to be reported on Microsoft's WinUI repo

MartinZikmund avatar Feb 27 '24 11:02 MartinZikmund

This means the bug should also exist in the plain WinUI target. This one: https://github.com/Mapsui/Mapsui/tree/main/Mapsui.UI.WinUI. I can test that next week. It might also be related to the SkiaSharp control we use.

pauldendulk avatar Feb 27 '24 12:02 pauldendulk

I tested it on plain WinUI but I do not see there problem there. The Mapsui code is 100% shared between Mapsui.WinUI and Mapsui.Uno.WinUI, so it is somehow related to Uno.

The problem can be reproduced on my laptop screen if the Scale of the monitor is not set to 100%. It is not related to second or first monitor (which makes it a simpler problem I guess).

It might be related to SkiaSharp.Views.Uno.WinUI.SKXamlCanvas somehow. Although the mouse wheel event is attached to the page and not to the canvas, still I did notice in other experiments that the child can influence the parents mouse wheel events.

pauldendulk avatar Mar 18 '24 13:03 pauldendulk

@MartinZikmund could it be related to https://github.com/unoplatform/uno.templates/blob/548712a42cead980526bf41996d2863f9d2a080c/src/Uno.Templates/content/unoapp/MyExtensionsApp.1.Windows/app.manifest#L22 ?

jeromelaban avatar Mar 18 '24 14:03 jeromelaban

We also have a Uno warning: Uno0001 PointerWheelChanged is not implemented in Uno. My original thought that this applies to iOS and Android, but perhaps it is related to this problem on Windows.

image

pauldendulk avatar Mar 23 '24 16:03 pauldendulk

@dr1rrb do we not have support for this across platforms? It may just be that event that is marked as not implemented, but actually is working.

jeromelaban avatar Mar 25 '24 13:03 jeromelaban

@MartinZikmund could it be related to unoplatform/uno.templates@548712a/src/Uno.Templates/content/unoapp/MyExtensionsApp.1.Windows/app.manifest#L22 ?

I see the default WinUI3 template has a simpler app.manifest now:

<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
  <assemblyIdentity version="1.0.0.0" name="App77.app"/>

  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <!-- The ID below informs the system that this application is compatible with OS features first introduced in Windows 10. 
      It is necessary to support features in unpackaged applications, for example the custom titlebar implementation.
      For more info see https://docs.microsoft.com/windows/apps/windows-app-sdk/use-windows-app-sdk-run-time#declare-os-compatibility-in-your-application-manifest -->
      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
    </application>
  </compatibility>
  
  <application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
      <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
    </windowsSettings>
  </application>
</assembly>

@pauldendulk can you try replacing the one we generate with this one to see if there is any improvement?

MartinZikmund avatar Mar 25 '24 13:03 MartinZikmund

@dr1rrb do we not have support for this across platforms? It may just be that event that is marked as not implemented, but actually is working.

It is marked as not implemented on non-WASM and -Skia targets, which is correct currently

MartinZikmund avatar Mar 25 '24 13:03 MartinZikmund

I pasted in the code as you suggested but see no difference. The next thing would be to make a minimal sample without Mapsui and only the SkiaViews and a mouse wheel event. I wanted to do this last weeks but could not find for it and probably won't the coming weeks.

pauldendulk avatar Apr 26 '24 17:04 pauldendulk