[client,sdl] use member instead of static variable
This commit is contained in:
parent
b3fdebfdf7
commit
ff26ca1e39
@ -472,22 +472,16 @@ BOOL sdlInput::keyboard_grab(Uint32 windowID, SDL_bool enable)
|
||||
|
||||
BOOL sdlInput::mouse_focus(Uint32 windowID)
|
||||
{
|
||||
static Uint32 lastWindowID = -1;
|
||||
|
||||
if (lastWindowID != windowID)
|
||||
if (_lastWindowID != windowID)
|
||||
{
|
||||
lastWindowID = windowID;
|
||||
_lastWindowID = windowID;
|
||||
SDL_Window* window = SDL_GetWindowFromID(windowID);
|
||||
if (!window)
|
||||
return FALSE;
|
||||
|
||||
SDL_RaiseWindow(window);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
};
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL sdlInput::mouse_grab(Uint32 windowID, SDL_bool enable)
|
||||
@ -506,7 +500,7 @@ BOOL sdlInput::mouse_grab(Uint32 windowID, SDL_bool enable)
|
||||
#endif
|
||||
}
|
||||
|
||||
sdlInput::sdlInput(SdlContext* sdl) : _sdl(sdl)
|
||||
sdlInput::sdlInput(SdlContext* sdl) : _sdl(sdl), _lastWindowID(UINT32_MAX)
|
||||
{
|
||||
WINPR_ASSERT(_sdl);
|
||||
}
|
||||
|
@ -47,4 +47,5 @@ class sdlInput
|
||||
|
||||
private:
|
||||
SdlContext* _sdl;
|
||||
Uint32 _lastWindowID;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user