diff --git a/src/osx/advanced-scene-switcher-osx.mm b/src/osx/advanced-scene-switcher-osx.mm index 5972287f..05935906 100644 --- a/src/osx/advanced-scene-switcher-osx.mm +++ b/src/osx/advanced-scene-switcher-osx.mm @@ -26,6 +26,27 @@ void GetWindowList(vector &windows) } } +// Overloaded +void GetWindowList(QStringList &windows) +{ + windows.clear(); + + @autoreleasepool { + NSWorkspace *ws = [NSWorkspace sharedWorkspace]; + NSArray *array = [ws runningApplications]; + for (NSRunningApplication *app in array) { + NSString *name = app.localizedName; + if (!name) + continue; + + const char *str = name.UTF8String; + if (str && *str) + windows.emplace_back(str); + windows << QString(str); + } + } +} + void GetCurrentWindowTitle(string &title) { title.resize(0); @@ -56,7 +77,8 @@ pair getCursorPos() return pos; } -bool isFullscreen() +// Argument added in lieu of fullscreen bug fix +bool isFullscreen(std::string &title) { @autoreleasepool { AXValueRef temp; diff --git a/src/win/advanced-scene-switcher-win.cpp b/src/win/advanced-scene-switcher-win.cpp index 677885a6..720b4a3b 100644 --- a/src/win/advanced-scene-switcher-win.cpp +++ b/src/win/advanced-scene-switcher-win.cpp @@ -58,6 +58,22 @@ void GetWindowList(vector& windows) } } +// Overloaded +void GetWindowList(QStringList &windows) +{ + windows.clear(); + + HWND window = GetWindow(GetDesktopWindow(), GW_CHILD); + + while (window) + { + string title; + if (WindowValid(window) && GetWindowTitle(window, title)) + windows << QString::fromStdString(title); + window = GetNextWindow(window, GW_HWNDNEXT); + } +} + void GetCurrentWindowTitle(string& title) { HWND window = GetForegroundWindow(); @@ -87,7 +103,8 @@ pair getCursorPos() return pos; } -bool isFullscreen() +// Argument added in lieu of fullscreen bug fix +bool isFullscreen(std::string &title) { RECT appBounds; RECT rc;