Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

Window positioned on wrong(?) monitor

Open Splitwirez opened this issue 1 year ago • 3 comments

Describe the bug In Avalonia 0.10.18, an Avalonia window would position itself on the monitor currently being interacted with when first opened. For whatever reason, after migrating to 11.0.0-preview2, they always appear on, at least in my case, my leftmost monitor...which isn't even my primary monitor.

To Reproduce Steps to reproduce the behavior:

  1. dotnet new avalonia.app
  2. Change version of all Avalonia PackageReferences to 11.0.0-preview2
  3. Add another PackageReference for Avalonia.Themes.Fluent (again, version 11.0.0-preview2)
  4. dotnet run

Expected behavior Avalonia windows appear on the monitor currently being interacted with, instead of inexplicably ~~trying to use my reflexes to snap my neck~~ appearing all the way to the top-left of the leftmost monitor.

Desktop:

  • OS: Linux (Kubuntu 20.04, x64)
  • Version 11.0.0-preview2

Additional context I'm guessing nobody else here is dumb enough to put their primary monitor/laptop on the right, besides myself? I've seen other apps suffer similar mental breakdowns whilst trying to comprehend this monitor arrangement, but an entire GUI framework? That could hit every app that uses Avalonia...

Splitwirez avatar Oct 26 '22 22:10 Splitwirez

Strange, I have my primary monitor on the right, and I'm not seeing this.

EDIT: Ah sorry, linux, sorry I didn't notice. I'm running Windows.

grokys avatar Oct 28 '22 12:10 grokys

On macOS and windows app is correctly finding out that my primary monitor is the right one. ~Causing some pain, because I opened it from the Rider on the left.~ I guess some linux distros might have a better opinion, where to open the window. Or it's a bug in linux backend in avalonia.

maxkatz6 avatar Oct 28 '22 12:10 maxkatz6

~Causing some pain, because I opened it from the Rider on the left.~

@maxkatz6

My neck can relate...albeit in the opposite horizontal direction.

I guess some linux distros might have a better opinion, where to open the window. Or it's a bug in linux backend in avalonia.

I would consider the former a plausible (though unfortunate) explanation, but...considering this is new to the Avalonia 11 previews and doesn't happen with 0.10.x, I can't help but feel like the latter is more plausible...

On macOS and windows app is correctly finding out that my primary monitor is the right one.

Ironically, in spite of being a Linux main, I'd probably be better equipped to try to help fix this if it had happened on Windows...but it didn't.

That said...if there's anything I can do to help diagnose/investigate/fix the issue, please, do tell.

Splitwirez avatar Oct 28 '22 16:10 Splitwirez