Bug 8271

Summary: Screen.FromRectangle is buggy for multiple screens
Product: [Mono] Class Libraries Reporter: Stephen McConnel <stephen_mcconnel>
Component: Windows.FormsAssignee: Bugzilla <bugzilla>
Status: RESOLVED FIXED    
Severity: normal CC: eb1, masafa, mono-bugs+mono
Priority: Lowest    
Version: 2.10.x   
Target Milestone: Community   
Hardware: PC   
OS: Linux   
Tags: mono-community Is this bug a regression?: ---
Last known good build:
Attachments: The attachment contains a proposed implementation for Screen.FromRectangle.
The same fix, but in the form of a patch file (git diff)

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