Skip to content

Commit

Permalink
Fix for mac display dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
smasherprog committed Apr 8, 2017
1 parent d4fbab3 commit 76b62bd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ios/GetMonitors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@ namespace SL{
//only include non-mirrored displays
if(CGDisplayMirrorsDisplay(displays[i]) == kCGNullDirectDisplay){

auto imageRef = CGDisplayCreateImage(displays[i]);
if(!imageRef) continue;

auto width = CGImageGetWidth(imageRef);
auto height = CGImageGetHeight(imageRef);
CGImageRelease(imageRef);

auto r = CGDisplayBounds(displays[i]);

auto name = std::string("Monitor ") + std::to_string(displays[i]);
ret.push_back(CreateMonitor(i, displays[i], int(r.size.height),int(r.size.width), int(r.origin.x), int(r.origin.y), name ));
ret.push_back(CreateMonitor(i, displays[i],height,width, int(r.origin.x), int(r.origin.y), name ));
}
}
return ret;
Expand Down

0 comments on commit 76b62bd

Please sign in to comment.