mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-22 01:44:49 -05:00
parent
87da123c19
commit
f0cf5a5c19
|
|
@ -26,6 +26,27 @@ void GetWindowList(vector<string> &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<int, int> getCursorPos()
|
|||
return pos;
|
||||
}
|
||||
|
||||
bool isFullscreen()
|
||||
// Argument added in lieu of fullscreen bug fix
|
||||
bool isFullscreen(std::string &title)
|
||||
{
|
||||
@autoreleasepool {
|
||||
AXValueRef temp;
|
||||
|
|
|
|||
|
|
@ -58,6 +58,22 @@ void GetWindowList(vector<string>& 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<int, int> getCursorPos()
|
|||
return pos;
|
||||
}
|
||||
|
||||
bool isFullscreen()
|
||||
// Argument added in lieu of fullscreen bug fix
|
||||
bool isFullscreen(std::string &title)
|
||||
{
|
||||
RECT appBounds;
|
||||
RECT rc;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user