mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Fixed Win32 requestFocus in multithreaded environment
This commit is contained in:
parent
d29c51d82b
commit
e85ed33fb2
@ -430,8 +430,9 @@ void WindowImplWin32::setKeyRepeatEnabled(bool enabled)
|
||||
void WindowImplWin32::requestFocus()
|
||||
{
|
||||
// Allow focus stealing only within the same process; compare PIDs of current and foreground window
|
||||
DWORD thisPid = GetWindowThreadProcessId(m_handle, NULL);
|
||||
DWORD foregroundPid = GetWindowThreadProcessId(GetForegroundWindow(), NULL);
|
||||
DWORD thisPid, foregroundPid;
|
||||
GetWindowThreadProcessId(m_handle, &thisPid);
|
||||
GetWindowThreadProcessId(GetForegroundWindow(), &foregroundPid);
|
||||
|
||||
if (thisPid == foregroundPid)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user