swift-cross-ui icon indicating copy to clipboard operation
swift-cross-ui copied to clipboard

Windows 11 ARM issue

Open litewrap opened this issue 10 months ago • 8 comments

Hello, I'd like to continue the discussion I started on the Swift forum regarding the issue observed on Windows 11 ARM.

https://forums.swift.org/t/swiftui-for-non-apple-platforms-like-android-web-windows/25455/210

Here is a short video demonstrating the problem.

https://github.com/user-attachments/assets/9df8dc5e-48c4-4e34-bb55-4f3b1069c22a

litewrap avatar Apr 27 '25 13:04 litewrap

Using the latest commit, the DLL error no longer appear. Also the initial window content show up correctly. However the window content disappear when I click the + or - button. I have to resize the window to get the content to appear again.

litewrap avatar Apr 28 '25 11:04 litewrap

Hmm interesting, and does that only happen on ARM? Or x64 too?

stackotter avatar Apr 28 '25 12:04 stackotter

To be sure I just compiled with the latest commit on both ARM and Intel Windows 11. I can confirm that the behaviour is observed only on the ARM setup.

Can you build a setup for testing on Windows 11 ARM, for example, with Parallels Desktop on an Apple silicon Mac? Given that there are often subtle differences between the two architectures, and that ARM on PCs is increasingly popular, it seems to me that it would be good to systematically test on both processors.

Thanks for considering.

litewrap avatar Apr 28 '25 14:04 litewrap

A majority of my testing has been done in an ARM vm and I didn’t face the issue you’re facing. But it’s possible that the issue was introduced more recently than my last CounterExample test, so I’ll double check if I can reproduce the issue at all.

stackotter avatar Apr 28 '25 22:04 stackotter

Any news on any fixes for Windows 11 ARM ? In addition to testing using Parallels Desktop VM I tested using VMware fusion VM with the same result. What Windows 11 ARM vm are you using for your testing ?

litewrap avatar May 08 '25 13:05 litewrap

I'm using UTM to run my Windows 11 ARM VM. I just double checked and I get the exact same behaviour on arm64 Windows 11, x86_64 Windows 11 and x86_64 Windows 10; I can click the buttons of CounterExample and resize the window, and everything works just fine (apart from the window being slightly too tall, but I believe that that's unrelated to your issue).

stackotter avatar May 08 '25 16:05 stackotter

The problem seems related to the display DPI and screen scaling.

I set up a VM with UTM, and like you, the problem doesn't appear. At least with the default setting.

When looking for differences in display settings between Parallels, Fusion, and UTM VMs, I noticed that by default, Parallels and Fusion have the Display setting set to "Retina," and in Windows, the Display scale is set to "300%." With UTM, in Windows the Display scale is "100%."

You can reproduce the issue on UTM by changing the display scale in Windows 11 (System Display setting > Scale) and adjusting it to 125%, 150%, or higher. You will observe the Counter app window content shifting when clicking on the + or - button.

The odd thing is that this behavior only applies to Swift cross-UI apps. On all my Windows ARM VMs, all apps including WinUI apps like The Browser Company "Arc" and Microsoft "WinUi Gallery" have normal behaviour regardless of the VM Retina display mode enabled or not and the Windows Display scale to 100% or greater.

litewrap avatar May 09 '25 20:05 litewrap

Hmm weird, I thought I had fixed display scaling support a while ago. I’ll have to look at that again. Thanks for investigating further!

stackotter avatar May 09 '25 21:05 stackotter