mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-22 19:33:03 +00:00
if there is only one display, it is always the active one (#316)
This commit is contained in:
parent
f48e9217b6
commit
4981a906c9
1 changed files with 14 additions and 4 deletions
|
@ -138,13 +138,23 @@ int display_arrangement(uint32_t did) {
|
|||
}
|
||||
|
||||
uint32_t display_main_display_id(void) {
|
||||
return CGMainDisplayID();
|
||||
return CGMainDisplayID();
|
||||
}
|
||||
|
||||
CFStringRef display_active_display_uuid(void) {
|
||||
CFStringRef menubar = SLSCopyActiveMenuBarDisplayIdentifier(g_connection);
|
||||
if (!menubar) return display_uuid(CGMainDisplayID());
|
||||
return menubar;
|
||||
if (display_active_display_count() == 1) {
|
||||
uint32_t did = 0;
|
||||
uint32_t count = 0;
|
||||
CGGetActiveDisplayList(1, &did, &count);
|
||||
if (count == 1)
|
||||
return display_uuid(did);
|
||||
else {
|
||||
printf("Error: No active display found!\n");
|
||||
}
|
||||
}
|
||||
|
||||
CFStringRef menubar = SLSCopyActiveMenuBarDisplayIdentifier(g_connection);
|
||||
return menubar;
|
||||
}
|
||||
|
||||
uint32_t display_active_display_id(void) {
|
||||
|
|
Loading…
Reference in a new issue