Question about the display
Question about the display
How can I find out what mode the screen has? (Extended, mirror)
Re: Question about the display
Over NSScreen: https://developer.apple.com/documentati ... guage=objc
And search forum at "nsscreen"
And search forum at "nsscreen"
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Question about the display
There is a built-in function to determine if the display is being mirrored:
But I'm not sure how to determine if the display has been extended.
Code: Select all
ImportC ""
CGMainDisplayID()
CGDisplayIsInMirrorSet(displayId)
EndImport
If Not CGDisplayIsInMirrorSet(CGMainDisplayID())
mirror$ = "not "
EndIf
MessageRequester("Mac Main Display", "The screen is " + mirror$ + "being mirrored.")
But I'm not sure how to determine if the display has been extended.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 
Re: Question about the display
Answer form ChatGPT:
Code: Select all
@import CoreGraphics;
BOOL isExtendedDesktop(void) {
uint32_t count = 0;
CGGetActiveDisplayList(0, NULL, &count);
if (count <= 1) return NO;
CGDirectDisplayID displays[count];
CGGetActiveDisplayList(count, displays, &count);
for (uint32_t i = 0; i < count; i++) {
if (CGDisplayIsInMirrorSet(displays[i])) {
return NO; // mirroring active
}
}
return YES; // muliple displays, no mirroring => extended
}


