mirror of
https://github.com/ddeverill/SteamlessController.git
synced 2026-10-22 06:32:20 -05:00
Auto-enable Steamless mode after startup reconnect
This commit is contained in:
1 parent
a660f671b4
commit
bc3e9932b1
4 files changed
+29
No files matched your search
@@ -14,6 +14,8 @@ TrayApp::TrayApp() {
|
||||
}
|
||||
|
||||
TrayApp::~TrayApp() {
|
||||
if (m_hwnd)
|
||||
KillTimer(m_hwnd, TIMER_RECONNECT);
|
||||
RemoveTrayIcon();
|
||||
g_app = nullptr;
|
||||
}
|
||||
@@ -52,6 +54,7 @@ bool TrayApp::Init(HINSTANCE hInstance) {
|
||||
|
||||
LoadSettings();
|
||||
AddTrayIcon();
|
||||
SetTimer(m_hwnd, TIMER_RECONNECT, 2000, nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -121,6 +124,11 @@ LRESULT TrayApp::HandleMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {
|
||||
m_controller->OnDeviceChange();
|
||||
return TRUE;
|
||||
|
||||
case WM_TIMER:
|
||||
if (wp == TIMER_RECONNECT)
|
||||
m_controller->Tick();
|
||||
return 0;
|
||||
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user