Re: multiple displays under Win32

On Thu, 25 Aug 2005 19:52:17 +0930
James McArthur <jamesm internode on net> wrote:

It would appear Mike Davis said the following on 08/25/05 18:04:
Under WinXP it's just one big screen with the geometry being the 
maximum width/height of all the screens together.

To the best of my knowledge, Windows treats two monitors as one big
screen (stretch mode) or as a direct copy of the main screen (clone
mode). Thats the best Windows provides.

I think you're going to be stuck with a nasty hard coding exercise.

Thanks for all the responses, last night I found the solution I'm looking for :-)

Here's a way of getting the monitor geometry for Win32 multi displays:

foreach my $display (Gtk2::Gdk::DisplayManager->get->list_displays) {
        print "display name [", $display->get_name, "] num screens [", $display->get_n_screens, "]";

        my $defaultScreen = $display->get_default_screen;
        print "\tscreen num monitors [", $defaultScreen->get_n_monitors, "]\n";
        for(my $monitorNumber = 0; $monitorNumber < $defaultScreen->get_n_monitors; $monitorNumber++) {
                my $monitorGeometry = $defaultScreen->get_monitor_geometry($monitorNumber);
                print "\t\tmonitorNumber [$monitorNumber] geometry h [", $monitorGeometry->height, "] w [", 
$monitorGeometry->width, "] x [", $monitorGeometry->x, "] y [", $monitorGeometry->y, "]\n";

I suppose the '->list_displays' loop is unnecessary for Win32, but this way it can be made to work for both 
Linux and Win32, although a loop is required for the screens under Linux.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]