summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-24 00:31:26 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-24 21:08:17 +0300
commit076e2f4655c43e7dc79a01d576551942c7c3c057 (patch)
tree39bce5d299283f2bf00c24bff414331e714d8f21 /src/gui/gui.cpp
parentc88734cc2b8a0785c23531ce70bf703887aa0c4b (diff)
downloadplus-076e2f4655c43e7dc79a01d576551942c7c3c057.tar.gz
plus-076e2f4655c43e7dc79a01d576551942c7c3c057.tar.bz2
plus-076e2f4655c43e7dc79a01d576551942c7c3c057.tar.xz
plus-076e2f4655c43e7dc79a01d576551942c7c3c057.zip
show/hide mouse cursor if mouse in/out window.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 9441677a6..dda067644 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -32,6 +32,7 @@
#include "gui/widgets/mouseevent.h"
#include "gui/widgets/window.h"
+#include "client.h"
#include "configuration.h"
#include "dragdrop.h"
#include "keydata.h"
@@ -446,13 +447,8 @@ void Gui::draw()
int mouseX, mouseY;
const uint8_t button = SDL_GetMouseState(&mouseX, &mouseY);
-#ifdef USE_SDL2
- // +++ need check also is window have mouse focus SDL_GetMouseFocus
- if (mMouseCursors && mCustomCursor && mMouseCursorAlpha > 0.0f)
-#else
- if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS || button & SDL_BUTTON(1))
+ if ((client->getMouseFocused() || button & SDL_BUTTON(1))
&& mMouseCursors && mCustomCursor && mMouseCursorAlpha > 0.0f)
-#endif
{
Graphics *g2 = static_cast<Graphics*>(mGraphics);
const Image *const image = dragDrop.getItemImage();