Immediate-Mode-UI / Immediate-Mode-UI/Nuklear

[BUG, BACKEND: D3D9] Clipboard paste broken for D3D9 backend

Open
#858 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11.4k
Forks
686
Avg merge
4d 1h
Merged PRs (30d)
3

Description

The clipboard paste functionality in the Nuklear D3D9 backend is broken due to an incorrect check when opening the clipboard. In the current implementation of `nk_d3d9_clipboard_paste`:
https://github.com/Immediate-Mode-UI/Nuklear/blob/fcd64f85e54b9d35eee13347748d70fa4d2e134e/demo/d3d9/nuklear_d3d9.h#L484-L486

This differs from other DirectX backends (D3D11, D3D12), where the paste function works correctly and this bug does not occur.

**As enhancement**. However, it is worth noting that even in those backends the order of operations is somewhat questionable: they call `IsClipboardFormatAvailable` before opening the clipboard with `OpenClipboard(NULL)`.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in demo/d3d9/nuklear_d3d9.h around nk_d3d9_clipboard_paste at lines 484-486. Compare its clipboard-opening check with the working D3D11 and D3D12 paste implementations, including their operation order. Done means clipboard paste works correctly in the D3D9 backend.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
desktop
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.