Bug 8271 - Screen.FromRectangle is buggy for multiple screens
Summary: Screen.FromRectangle is buggy for multiple screens
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: Windows.Forms ()
Version: 2.10.x
Hardware: PC Linux
: Lowest normal
Target Milestone: Community
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-11-07 16:55 UTC by Stephen McConnel
Modified: 2017-09-01 12:17 UTC (History)
3 users (show)

Tags: mono-community
Is this bug a regression?: ---
Last known good build:


Attachments
The attachment contains a proposed implementation for Screen.FromRectangle. (1.23 KB, text/x-csharp)
2012-11-07 16:55 UTC, Stephen McConnel
Details
The same fix, but in the form of a patch file (git diff) (1.49 KB, patch)
2012-11-07 18:21 UTC, Stephen McConnel
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Stephen McConnel 2012-11-07 16:55:37 UTC
Created attachment 2881 [details]
The attachment contains a proposed implementation for Screen.FromRectangle.

My system has a dual monitor setup, so it shows up as having two screens, side by side:

Screen 0: {X=0, Y=0, Width=1600, Height=1200}
Screen 1: {X=1600, Y=0, Width=1600, Height=1200}

When passed a rectangle with the values {X=1585, Y=600, Width=800, Height=600}, Screen.FromRectangle returns Screen 0 in Mono, but returns Screen 1 in Windows .Net.  This is causing problems in a program that we're developing.  The documentation indicates that the best fitting screen should be returned, not the one containing the top left corner.
Comment 1 Stephen McConnel 2012-11-07 18:21:52 UTC
Created attachment 2882 [details]
The same fix, but in the form of a patch file (git diff)
Comment 2 eb1 2014-03-14 06:51:21 UTC
Patch included in PR #943