mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-11-05 16:38:17 +00:00
macos, periodically check if current display is changed
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
1 parent
f71d4e9e81
commit
b8b3e99602
4 files changed
+14
-7
No files matched your search
@@ -60,7 +60,7 @@ extern "C" bool MacGetModes(CGDirectDisplayID display, uint32_t *widths, uint32_
|
||||
return false;
|
||||
}
|
||||
*numModes = CFArrayGetCount(allModes);
|
||||
for (int i = 0; i < *numModes && i < max; i++) {
|
||||
for (uint32_t i = 0; i < *numModes && i < max; i++) {
|
||||
CGDisplayModeRef mode = (CGDisplayModeRef)CFArrayGetValueAtIndex(allModes, i);
|
||||
widths[i] = (uint32_t)CGDisplayModeGetWidth(mode);
|
||||
heights[i] = (uint32_t)CGDisplayModeGetHeight(mode);
|
||||
@@ -136,7 +136,6 @@ extern "C" bool MacSetMode(CGDirectDisplayID display, uint32_t width, uint32_t h
|
||||
return ret;
|
||||
}
|
||||
int numModes = CFArrayGetCount(allModes);
|
||||
CGDisplayModeRef bestMode = NULL;
|
||||
for (int i = 0; i < numModes; i++) {
|
||||
CGDisplayModeRef mode = (CGDisplayModeRef)CFArrayGetValueAtIndex(allModes, i);
|
||||
if (width == CGDisplayModeGetWidth(mode) &&
|
||||
|
||||
Reference in new issue
Block a user