Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '...a small addition...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
...a small addition...
Authored by: wallybear on Apr 18, '09 07:55:34AM
Changing my ListDisplays() function with the following, we can see which display is the primary (i.e. the one with the menu bar):

void ListDisplays( CGDisplayCount dispCount, CGDirectDisplayID *dispArray )
{
	int	h, v, depth, freq, i;
	CGDirectDisplayID mainDisplay = CGMainDisplayID();
	
		printf("Displays found: %d\n", dispCount);
		for	(i = 0 ; i < dispCount ;  i++ ) {

			GetDisplayParms(dispArray, i, &h, &v, &depth, &freq);
			printf("Display %d (id %d):  %d x %d x %d @ %dHz", i+1, dispArray[i], h, v, depth, freq);
			if ( mainDisplay == dispArray[i] ) 
				printf(" (main)\n");
			else
				printf("\n");
		}
}
With this mod, the displays listing (using setgetscreenres -l) will look like this one:

Displays found: 3
Display 1 (id 180814742):  1024 x 768 x 32 @ 75Hz
Display 2 (id 188810672):  1920 x 1080 x 32 @ 60Hz (main)
Display 3 (id 160845621):  1440 x 900 x 32 @ 60Hz
stating that Display 2 is the main display.


[ Reply to This | # ]