Win32: no WM_SETCURSOR reaches DefWindowProc, so the borders show no resize cursors #181

Open
opened 2026-10-31 17:22:46 +00:00 by jorijnvdgraaf · 0 comments

Summary

On Win32 no WM_SETCURSOR reaches DefWindowProc, so the window's borders and corners show no resize cursors, and the class cursor is never applied in the client area. Line numbers refer to implementations/Crafter.Graphics-Window.cpp at 852ae8a.

The WM_SETCURSOR case (:331-337) returns TRUE after SetCursor only for the client area with a custom cursor, and otherwise breaks to return 0 (:341). DefWindowProc is what sets the resize arrows for the border hit-test codes, and the class cursor (IDC_ARROW, :407) for HTCLIENT.

The custom branch never runs either: SetCursorImage has no Win32 body (:889-892, "Win32 cursor support is not implemented for the v2 Window"), so cursorHandle is never set, and every WM_SETCURSOR takes the return 0 path.

What it looks like: hovering a border shows no resize arrow, though dragging still resizes, and a pointer coming in from another window keeps that window's cursor (an editor's I-beam, say) until something else changes it.

Found while reviewing claude/win32-title.

Suggested fix

Replace the break with return DefWindowProc(hwnd, msg, wParam, lParam); (DefWindowProcW once claude/win32-title lands). SetCursorImage and SetDefaultCursor for Win32 (CreateIconIndirect from the RGBA pixels, DestroyCursor on replacement) are a separate gap; until they exist, the interface could say they are Wayland-only.

## Summary On Win32 no `WM_SETCURSOR` reaches `DefWindowProc`, so the window's borders and corners show no resize cursors, and the class cursor is never applied in the client area. Line numbers refer to `implementations/Crafter.Graphics-Window.cpp` at `852ae8a`. The `WM_SETCURSOR` case (`:331-337`) returns `TRUE` after `SetCursor` only for the client area with a custom cursor, and otherwise `break`s to `return 0` (`:341`). `DefWindowProc` is what sets the resize arrows for the border hit-test codes, and the class cursor (`IDC_ARROW`, `:407`) for `HTCLIENT`. The custom branch never runs either: `SetCursorImage` has no Win32 body (`:889-892`, "Win32 cursor support is not implemented for the v2 Window"), so `cursorHandle` is never set, and every `WM_SETCURSOR` takes the `return 0` path. What it looks like: hovering a border shows no resize arrow, though dragging still resizes, and a pointer coming in from another window keeps that window's cursor (an editor's I-beam, say) until something else changes it. Found while reviewing `claude/win32-title`. ## Suggested fix Replace the `break` with `return DefWindowProc(hwnd, msg, wParam, lParam);` (`DefWindowProcW` once `claude/win32-title` lands). `SetCursorImage` and `SetDefaultCursor` for Win32 (`CreateIconIndirect` from the RGBA pixels, `DestroyCursor` on replacement) are a separate gap; until they exist, the interface could say they are Wayland-only.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Catcrafts/Crafter.Graphics#181
No description provided.