input: ignore mouse handler events until initialized

And revert the now obsolete reload requests
This commit is contained in:
Megamouse 2024-08-08 19:06:05 +02:00
parent bc23615508
commit 60b90075ac
2 changed files with 12 additions and 4 deletions

View File

@ -25,8 +25,6 @@ void basic_mouse_handler::Init(const u32 max_connect)
input_log.notice("basic_mouse_handler: Could not load basic mouse config. Using defaults.");
}
g_cfg_mouse.reload_requested = true;
reload_config();
m_mice.clear();
@ -82,6 +80,12 @@ void basic_mouse_handler::SetTargetWindow(QWindow* target)
bool basic_mouse_handler::eventFilter(QObject* target, QEvent* ev)
{
if (m_info.max_connect == 0)
{
// Not initialized
return false;
}
if (!ev)
{
return false;

View File

@ -267,8 +267,6 @@ void raw_mouse_handler::Init(const u32 max_connect)
input_log.notice("raw_mouse_handler: Could not load raw mouse config. Using defaults.");
}
g_cfg_raw_mouse.reload_requested = true;
m_mice.clear();
m_mice.resize(max_connect);
@ -559,6 +557,12 @@ std::map<void*, raw_mouse> raw_mouse_handler::enumerate_devices(u32 max_connect)
#ifdef _WIN32
void raw_mouse_handler::handle_native_event(const MSG& msg)
{
if (m_info.max_connect == 0)
{
// Not initialized
return;
}
if (msg.message != WM_INPUT)
{
return;