void RefreshActiveDisplays(bool ShouldFocusScreen) { if(KWMScreen.Displays) free(KWMScreen.Displays); KWMScreen.Displays = (CGDirectDisplayID*) malloc(sizeof(CGDirectDisplayID) * KWMScreen.MaxCount); CGGetActiveDisplayList(KWMScreen.MaxCount, KWMScreen.Displays, &KWMScreen.ActiveCount); for(std::size_t DisplayIndex = 0; DisplayIndex < KWMScreen.ActiveCount; ++DisplayIndex) { unsigned int DisplayID = KWMScreen.Displays[DisplayIndex]; std::map<unsigned int, screen_info>::iterator It = KWMTiling.DisplayMap.find(DisplayID); if(It != KWMTiling.DisplayMap.end()) UpdateExistingScreenInfo(&KWMTiling.DisplayMap[DisplayID], DisplayID, DisplayIndex); else KWMTiling.DisplayMap[DisplayID] = CreateDefaultScreenInfo(DisplayID, DisplayIndex); DEBUG("DisplayID " << DisplayID << " has index " << DisplayIndex << " and Identifier " << CFStringGetCStringPtr(KWMTiling.DisplayMap[DisplayID].Identifier,kCFStringEncodingUTF8)); } if (ShouldFocusScreen) { screen_info *NewScreen = GetDisplayOfMousePointer(); if(NewScreen) GiveFocusToScreen(NewScreen->ID, NULL, false, true); } }
void GetActiveDisplays() { CGGetActiveDisplayList(MaxDisplayCount, (CGDirectDisplayID*)&ActiveDisplays, &ActiveDisplaysCount); for(int DisplayIndex = 0; DisplayIndex < ActiveDisplaysCount; ++DisplayIndex) { unsigned int DisplayID = ActiveDisplays[DisplayIndex]; DisplayMap[DisplayID] = CreateDefaultScreenInfo(DisplayID, DisplayIndex);; DEBUG("DisplayID " << DisplayID << " has index " << DisplayIndex) } Screen = GetDisplayOfMousePointer(); CGDisplayRegisterReconfigurationCallback(DisplayReconfigurationCallBack, NULL); }
void GetActiveDisplays() { KWMScreen.Displays = (CGDirectDisplayID*) malloc(sizeof(CGDirectDisplayID) * KWMScreen.MaxCount); CGGetActiveDisplayList(KWMScreen.MaxCount, KWMScreen.Displays, &KWMScreen.ActiveCount); for(int DisplayIndex = 0; DisplayIndex < KWMScreen.ActiveCount; ++DisplayIndex) { unsigned int DisplayID = KWMScreen.Displays[DisplayIndex]; DisplayMap[DisplayID] = CreateDefaultScreenInfo(DisplayID, DisplayIndex);; DEBUG("DisplayID " << DisplayID << " has index " << DisplayIndex) } KWMScreen.Current = GetDisplayOfMousePointer(); CGDisplayRegisterReconfigurationCallback(DisplayReconfigurationCallBack, NULL); }
void RefreshActiveDisplays() { CGGetActiveDisplayList(MaxDisplayCount, (CGDirectDisplayID*)&ActiveDisplays, &ActiveDisplaysCount); for(int DisplayIndex = 0; DisplayIndex < ActiveDisplaysCount; ++DisplayIndex) { unsigned int DisplayID = ActiveDisplays[DisplayIndex]; std::map<unsigned int, screen_info>::iterator It; if(It != DisplayMap.end()) UpdateExistingScreenInfo(&DisplayMap[DisplayID], DisplayID, DisplayIndex); else DisplayMap[DisplayID] = CreateDefaultScreenInfo(DisplayID, DisplayIndex); DEBUG("DisplayID " << DisplayID << " has index " << DisplayIndex) } Screen = GetDisplayOfMousePointer(); }
void GetActiveDisplays() { KWMScreen.Displays = (CGDirectDisplayID*) malloc(sizeof(CGDirectDisplayID) * KWMScreen.MaxCount); CGGetActiveDisplayList(KWMScreen.MaxCount, KWMScreen.Displays, &KWMScreen.ActiveCount); for(std::size_t DisplayIndex = 0; DisplayIndex < KWMScreen.ActiveCount; ++DisplayIndex) { unsigned int DisplayID = KWMScreen.Displays[DisplayIndex]; KWMTiling.DisplayMap[DisplayID] = CreateDefaultScreenInfo(DisplayID, DisplayIndex);; DEBUG("DisplayID " << DisplayID << " has index " << DisplayIndex << " and Identifier " << CFStringGetCStringPtr(KWMTiling.DisplayMap[DisplayID].Identifier,kCFStringEncodingUTF8)); } KWMScreen.Current = GetDisplayOfMousePointer(); KWMScreen.Current->ActiveSpace = GetActiveSpaceOfDisplay(KWMScreen.Current); ShouldActiveSpaceBeManaged(); CGDisplayRegisterReconfigurationCallback(DisplayReconfigurationCallBack, NULL); }
void RefreshActiveDisplays() { if(KWMScreen.Displays) free(KWMScreen.Displays); KWMScreen.Displays = (CGDirectDisplayID*) malloc(sizeof(CGDirectDisplayID) * KWMScreen.MaxCount); CGGetActiveDisplayList(KWMScreen.MaxCount, KWMScreen.Displays, &KWMScreen.ActiveCount); for(int DisplayIndex = 0; DisplayIndex < KWMScreen.ActiveCount; ++DisplayIndex) { unsigned int DisplayID = KWMScreen.Displays[DisplayIndex]; std::map<unsigned int, screen_info>::iterator It = DisplayMap.find(DisplayID); if(It != DisplayMap.end()) UpdateExistingScreenInfo(&DisplayMap[DisplayID], DisplayID, DisplayIndex); else DisplayMap[DisplayID] = CreateDefaultScreenInfo(DisplayID, DisplayIndex); DEBUG("DisplayID " << DisplayID << " has index " << DisplayIndex) } KWMScreen.Current = GetDisplayOfMousePointer(); }
void RefreshActiveDisplays() { CGGetActiveDisplayList(MaxDisplayCount, (CGDirectDisplayID*)&ActiveDisplays, &ActiveDisplaysCount); for(int DisplayIndex = 0; DisplayIndex < ActiveDisplaysCount; ++DisplayIndex) { unsigned int DisplayID = ActiveDisplays[DisplayIndex]; std::map<unsigned int, screen_info>::iterator It; if(It != DisplayMap.end()) { CGRect DisplayRect = CGDisplayBounds(ActiveDisplays[DisplayIndex]); DisplayMap[DisplayID].ID = DisplayIndex; DisplayMap[DisplayID].X = DisplayRect.origin.x; DisplayMap[DisplayID].Y = DisplayRect.origin.y; DisplayMap[DisplayID].Width = DisplayRect.size.width; DisplayMap[DisplayID].Height = DisplayRect.size.height; DisplayMap[DisplayID].PaddingTop = DefaultPaddingTop; DisplayMap[DisplayID].PaddingLeft = DefaultPaddingLeft; DisplayMap[DisplayID].PaddingRight = DefaultPaddingRight; DisplayMap[DisplayID].PaddingBottom = DefaultPaddingBottom; DisplayMap[DisplayID].VerticalGap = DefaultGapVertical; DisplayMap[DisplayID].HorizontalGap = DefaultGapHorizontal; DisplayMap[DisplayID].ForceContainerUpdate = true; } else { DisplayMap[DisplayID] = CreateDefaultScreenInfo(DisplayID, DisplayIndex); } DEBUG("DisplayID " << DisplayID << " has index " << DisplayIndex) } Screen = GetDisplayOfMousePointer(); }