Immediate-Mode-UI / Immediate-Mode-UI/Nuklear
Windows examples: unintended input behaviour when window goes out of focus
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 11.4k
- Forks
- 686
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 3
Description
When focus is lost, the mouse does not stop to grab on to widgets, my solution to the problem is this:
```c
case WM_KILLFOCUS:
nk_input_button(&ctx, NK_BUTTON_DOUBLE, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
nk_input_button(&ctx, NK_BUTTON_LEFT, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
nk_input_button(&ctx, NK_BUTTON_RIGHT, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
nk_input_button(&ctx, NK_BUTTON_MIDDLE, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
ReleaseCapture();
return 1;
```
However, i am unsure how correct this solution is. Maybe more than just mouse buttons are a problem here?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the Windows example's window-message handling, beginning at WM_KILLFOCUS and the existing nk_input_button calls. Compare focus-loss behavior for mouse and other input paths, then verify that widgets no longer retain unintended input capture after focus is lost.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100