void FocusedAXObserverCallback(AXObserverRef Observer, AXUIElementRef Element, CFStringRef Notification, void *ContextData) { Assert(Element, "AXOBserverCallback() Element was null") window_info *Window = KWMFocus.Window; if(!Window) return; if(CFEqual(Notification, kAXTitleChangedNotification)) Window->Name = GetWindowTitle(Element); if(IsWindowFloating(Window->WID, NULL) || IsApplicationFloating(Window)) UpdateBorder("focused"); if(!IsWindowFloating(Window->WID, NULL) && KWMToggles.EnableDragAndDrop && KWMToggles.DragInProgress && CFEqual(Notification, kAXWindowMovedNotification)) { KWMToggles.DragInProgress = false; KWMTiling.FloatingWindowLst.push_back(Window->WID); RemoveWindowFromBSPTree(KWMScreen.Current, Window->WID, false, false); if(KWMMode.Focus != FocusModeDisabled && KWMMode.Focus != FocusModeAutofocus && KWMToggles.StandbyOnFloat) { KWMMode.Focus = FocusModeStandby; } } }
std::vector<int> GetAllWindowIDsOnDisplay(int ScreenIndex) { screen_info *Screen = GetDisplayFromScreenID(ScreenIndex); std::vector<int> ScreenWindowIDLst; for(int WindowIndex = 0; WindowIndex < WindowLst.size(); ++WindowIndex) { window_info *Window = &WindowLst[WindowIndex]; if(!IsApplicationFloating(&WindowLst[WindowIndex])) { if(Window->X >= Screen->X && Window->X <= Screen->X + Screen->Width) ScreenWindowIDLst.push_back(Window->WID); } } return ScreenWindowIDLst; }