summaryrefslogtreecommitdiff
path: root/src/gui/sdlinput.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-25 20:39:03 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-25 20:39:03 +0300
commitfe64e7204c8ab7b91f36c305cce9f82e92792cb9 (patch)
tree47ac13448093d099d205b370740dc7952354799a /src/gui/sdlinput.cpp
parent529335b0e534c86cb1e4d735d9f4ffd576da728b (diff)
downloadmv-fe64e7204c8ab7b91f36c305cce9f82e92792cb9.tar.gz
mv-fe64e7204c8ab7b91f36c305cce9f82e92792cb9.tar.bz2
mv-fe64e7204c8ab7b91f36c305cce9f82e92792cb9.tar.xz
mv-fe64e7204c8ab7b91f36c305cce9f82e92792cb9.zip
Update mouse cursor each 10 seconds if was no mouse move events.
Diffstat (limited to 'src/gui/sdlinput.cpp')
-rw-r--r--src/gui/sdlinput.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp
index 6fc15dcbf..1219ad247 100644
--- a/src/gui/sdlinput.cpp
+++ b/src/gui/sdlinput.cpp
@@ -91,11 +91,14 @@ PRAGMA48(GCC diagnostic pop)
#include "debug.h"
+extern volatile time_t cur_time;
+
SDLInput *guiInput = nullptr;
SDLInput::SDLInput() :
mKeyInputQueue(),
mMouseInputQueue(),
+ mMouseMoveTime(0),
mMouseDown(false),
mMouseInWindow(true)
{
@@ -265,6 +268,7 @@ void SDLInput::pushInput(const SDL_Event &event)
mouseInput.setType(MouseEventType::MOVED);
mouseInput.setTimeStamp(SDL_GetTicks());
mMouseInputQueue.push(mouseInput);
+ mMouseMoveTime = cur_time;
break;
}
#ifndef USE_SDL2
@@ -285,6 +289,7 @@ void SDLInput::pushInput(const SDL_Event &event)
mouseInput.setButton(MouseButton::EMPTY);
mouseInput.setType(MouseEventType::MOVED);
mMouseInputQueue.push(mouseInput);
+ mMouseMoveTime = cur_time;
}
}
@@ -354,6 +359,10 @@ void SDLInput::simulateMouseMove()
if (gui == nullptr)
return;
+ if (mMouseMoveTime == cur_time)
+ return;
+
+ mMouseMoveTime = cur_time;
int x, y;
Gui::getMouseState(x, y);