changeset 1146:ce180935334d

fix: windows cursor not visible on border 1
author sam <sam@basx.dev>
date Sat, 15 Jun 2024 12:28:04 +0700
parents 6a7f09909a37
children 4d9e345da772
files semicongine/platform/windows/window.nim
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/semicongine/platform/windows/window.nim	Sat Jun 15 11:57:05 2024 +0700
+++ b/semicongine/platform/windows/window.nim	Sat Jun 15 12:28:04 2024 +0700
@@ -60,6 +60,12 @@
     currentEvents.add(Event(eventType: events.MouseMoved, x: GET_X_LPARAM(lParam), y: GET_Y_LPARAM(lParam)))
   of WM_MOUSEWHEEL:
     currentEvents.add(Event(eventType: events.MouseWheel, amount: float32(GET_WHEEL_DELTA_WPARAM(wParam)) / WHEEL_DELTA))
+  of WM_SETCURSOR:
+    if LOWORD(lParam) == HTCLIENT:
+      ShowCursor(false)
+    else:
+      ShowCursor(true)
+    return true
   else:
     return DefWindowProc(hwnd, uMsg, wParam, lParam)