Clipboard refactor #16

Merged
IoI_xD merged 8 commits from clipboard into master 2026-04-16 13:53:42 +09:00
Owner

There's a discrepency where the entry widget calls MwLLGetClipboard upon getting Ctrl+V, but the Wayland platform invokes that on its own, something it needs to do because otherwise the entry widget doesn't check for middle click pastes on platforms that use it.

This PR fixes this by having the entry widget handle middle click paste on platforms that support it. To do this, it also accommodates for the fact that on Wayland there are two clipboards: the normal clipboard that is invoked upon ctrl+v, and a "primary clipboard" that emulates X11's middle click keyboard (which is not avaliable on every compositor because this is an unstable protocol).

Changes:

  • New "MwClipboardType" enum that gets passed into MwGetClipboard (and MwLLGetClipboard) to distinquish between the main keyboard and the primary keyboard. Currently only the Wayland backend listens to this because the X11 doesn't distinquish them.
  • Entry widget now listens on mouse_up for a middle click and then invokes the primary keyboard, but only if the platform supports it and is currently being used. Otherwise, it just invokes MwForceRender2 as before.

Also this adds the MwClipboard stuff into milsko.xml

There's a discrepency where the entry widget calls MwLLGetClipboard upon getting Ctrl+V, but the Wayland platform invokes that on its own, something it needs to do because otherwise the entry widget doesn't check for middle click pastes on platforms that use it. This PR fixes this by having the entry widget handle middle click paste on platforms that support it. To do this, it also accommodates for the fact that on Wayland there are two clipboards: the normal clipboard that is invoked upon ctrl+v, and a "primary clipboard" that emulates X11's middle click keyboard (which is not avaliable on every compositor because this is an unstable protocol). Changes: - New "MwClipboardType" enum that gets passed into MwGetClipboard (and MwLLGetClipboard) to distinquish between the main keyboard and the primary keyboard. Currently only the Wayland backend listens to this because the X11 doesn't distinquish them. - Entry widget now listens on `mouse_up` for a middle click and then invokes the primary keyboard, but only if the platform supports it and is currently being used. Otherwise, it just invokes MwForceRender2 as before. Also this adds the MwClipboard stuff into milsko.xml
clipboard refactoring
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
b641a03bae
Merge branch 'master' into clipboard
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
220b76135e
IoI_xD merged commit 220b76135e into master 2026-04-16 13:53:42 +09:00
Sign in to join this conversation.
No reviewers
No labels
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
pyrite-dev/milsko!16
No description provided.