summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMattias Cibien <mattias@mattiascibien.net>2016-05-09 15:18:08 +0200
committerMattias Cibien <mattias@mattiascibien.net>2016-05-09 15:18:08 +0200
commit0b64b97d41cd298b03d064316c19c63dbf7f355b (patch)
tree75760c0c74f7374872a5f00148a25f3b04b640fb /platform
parent8a45936abd8679b5128e9d990b2c563afac72379 (diff)
Cursor hides only in client area
At the moment is however restored when going out and then in again.
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/os_windows.cpp18
-rw-r--r--platform/windows/os_windows.h2
2 files changed, 19 insertions, 1 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 352b7d645f..2284a51d58 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -705,6 +705,23 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) {
joystick->probe_joysticks();
} break;
+ case WM_SETCURSOR: {
+
+ if(LOWORD(lParam) == HTCLIENT) {
+ if(mouse_mode == MOUSE_MODE_HIDDEN) {
+ //Hide the cursor
+ if(hCursor == NULL)
+ hCursor = SetCursor(NULL);
+ }
+ else {
+ if(hCursor != NULL) {
+ SetCursor(hCursor);
+ hCursor = NULL;
+ }
+ }
+ }
+
+ } break;
default: {
@@ -1211,7 +1228,6 @@ void OS_Windows::set_mouse_mode(MouseMode p_mode) {
if (mouse_mode==p_mode)
return;
- ShowCursor(p_mode==MOUSE_MODE_VISIBLE);
mouse_mode=p_mode;
if (p_mode==MOUSE_MODE_CAPTURED) {
RECT clipRect;
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index 81cf313849..adea26308f 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -103,6 +103,8 @@ class OS_Windows : public OS {
HDC hDC; // Private GDI Device Context
HINSTANCE hInstance; // Holds The Instance Of The Application
HWND hWnd;
+
+ HCURSOR hCursor;
Size2 window_rect;
VideoMode video_mode;