Identify monitors

Daniel Hazelbaker daniel at highdesertchurch.com
Wed Oct 17 08:19:22 PDT 2007


Those of you on quartz-dev will have seen a somewhat related post  
from me recently about multiple monitors.  This came up in the same  
issue.  I have a program that (can) renders to multiple displays over  
multiple video cards.  To identify the displays uniquely I had been  
using the viewport of the display (origin and size).  This works  
fairly well with only 2 displays.  I recently moved to a machine with  
4 displays and things get a little funky.  Displays move, resize,  
swap positions, and things get all confused if a monitor is unplugged  
because that just shifts Everything around.

Here is my setup:
Display 1: DVI connection to Sceptre 22"
Display 2: DVI connection to video switcher (shows up as a unique  
vendor/model)
Display 3: VGA connection to video switcher (shows up as a generic  
VGA device)
Display 4: VGA connection to projector (shows up as a generic VGA  
device, same #s as display 3)

I have looked at using the Vendor ID, Model ID & Serial # of the  
displays, but none of the hooked up devices have serial #'s returned  
and, as I have seen with display 3 & 4, if I have 2 devices hooked up  
that are the same then I will get duplicate numbers.  Is this my best  
bet to use the VendorID, ModelID and serial # and then if I have  
multiple matches use the viewport origin and hope they haven't moved  
any displays around or is there a better way that I have not found yet?

I fear, though, that this is the best way. :/

Daniel


More information about the MacOSX-dev mailing list