Using Screen.FromPoint(Cursor.Position) always returns `Display 0`
I'm trying to recreate the Windows screenshot utility on Linux using
Mono
, but I'm unable to get the monitor that has the mouse on it. Using Screen.FromPoint(Cursor.Position)
always returns Display 0
if it's run from a terminal on the secondary monitor, and returns Display 1
if run from a terminal on the primary monitor. Is this a bug or have I made a mistake?11 Replies
Cursor.Position
also returns incorrect values. For example, the secondary monitor is 1920x1080 and it will return something like (1920, 1230)
This happens on the primary monitor as well. The size is 2560x1440 and it will return something like (3078, 600)'
Seems that using PointToClient
makes everything work as intended
except that the terminal issue now always returns the secondary monitor
it is no longer working
seems Mono is a bit buggyNot much serious work has been done on Mono WinForms in about a decade.
It's certainly not a tool I would use to be taking screenshots, though.
Do you have any recommendations?
I Haven't learned the WPF / XAML side of things yet, as I personally dislike it
PInvoke X11 directly
That won't be super cross-platform though will it?
No. But who cares?
Just write different code for just that.
That makes things a lot more annoying for me. Say a certain distro doesn't have X11, I don't want to have to maintain an X11 and Wayland version
And that might not even work across multiple operating systems
BSD support would be a huge maybe, but I'd still like to have that option available
The chances of any of this working in monos WinForms across all of that is nil, for the same reason
But go for it I guess.
I'm thinking of moving away from Mono for this reason, I just don't know if any other decent frameworks
Well there's always .net
Does .NET run on BSD OSes?
What GUI frameworks can I use with it?
I knopw there are Avalonia, Uno, Maui, WPF, etc but those all use XAML as far as I'm aware
I'm not very fond of XAML app development