mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-30 22:13:54 +00:00
Use CGDisplayBounds not CGDisplayPixelsWide, optimize get mac display size
This commit is contained in:
parent
d9a01c0511
commit
fbaa3998c6
@ -11,8 +11,10 @@
|
||||
MMSizeInt32 getMainDisplaySize(void){
|
||||
#if defined(IS_MACOSX)
|
||||
CGDirectDisplayID displayID = CGMainDisplayID();
|
||||
return MMSizeInt32Make((int32_t)CGDisplayPixelsWide(displayID),
|
||||
(int32_t)CGDisplayPixelsHigh(displayID));
|
||||
CGRect displayRect = CGDisplayBounds(displayID);
|
||||
|
||||
CGSize size = displayRect.size;
|
||||
return MMSizeInt32Make((int32_t)size.width, (int32_t)size.height);
|
||||
#elif defined(USE_X11)
|
||||
Display *display = XGetMainDisplay();
|
||||
const int screen = DefaultScreen(display);
|
||||
|
Loading…
Reference in New Issue
Block a user