mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-30 05:06:14 -05:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc4a3560d8 | ||
|
|
3ab2ea9e66 |
@@ -181,12 +181,6 @@ static bool windowIsValid(HWND window)
|
||||
return false;
|
||||
}
|
||||
|
||||
DWORD id;
|
||||
GetWindowThreadProcessId(window, &id);
|
||||
if (id == GetCurrentProcessId()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only accept for top level windows and not controls within them
|
||||
if (window != GetAncestor(window, GA_ROOT)) {
|
||||
return false;
|
||||
|
||||
@@ -29,6 +29,12 @@ static void setTabVisible(QTabWidget *tabWidget, bool visible)
|
||||
obs_module_text("AdvSceneSwitcher.twitchConnectionTab.title"));
|
||||
}
|
||||
|
||||
static bool twitchTabIsSelected(QTabWidget *tabWidget)
|
||||
{
|
||||
return tabWidget->tabText(tabWidget->currentIndex()) ==
|
||||
obs_module_text("AdvSceneSwitcher.twitchConnectionTab.title");
|
||||
}
|
||||
|
||||
TwitchConnectionsTable *TwitchConnectionsTable::Create()
|
||||
{
|
||||
tabWidget = new TwitchConnectionsTable();
|
||||
@@ -211,11 +217,11 @@ static void setupTab(QTabWidget *tab)
|
||||
}
|
||||
});
|
||||
|
||||
auto timer = new QTimer(tabWidget);
|
||||
timer->setInterval(1000);
|
||||
QWidget::connect(timer, &QTimer::timeout,
|
||||
[]() { updateConnectionStatus(tabWidget->Table()); });
|
||||
timer->start();
|
||||
QWidget::connect(tab, &QTabWidget::currentChanged, [tab]() {
|
||||
if (twitchTabIsSelected(tab)) {
|
||||
updateConnectionStatus(tabWidget->Table());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
||||
Reference in New Issue
Block a user