Commit e1b10fb
fix(windows): clipboard paste — probe first, real backoff, in-band fallback
The Windows clipboard open is system-global exclusive and WebView2's
process snapshots it around the paste event; clipboard-win's built-in
retries are Sleep(0) scheduler yields that burn out inside that window,
and the failure was swallowed into an empty list after the frontend had
already preventDefault'ed — a completely silent dead paste.
- Read probes CF_HDROP without opening the clipboard (text and image
pastes no longer touch the contended open at all), retries the open
with a real 10ms backoff, and surfaces the final failure instead of
faking an empty file list.
- Write replaces the yield-spin with the same backoff.
- The paste handler captures the first file item of ANY kind (not just
images) synchronously — when the native path read fails, the file's
in-band bytes and real filename still open the preview.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent fe7729b commit e1b10fb
2 files changed
Lines changed: 70 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
80 | 100 | | |
81 | 101 | | |
82 | 102 | | |
| |||
165 | 185 | | |
166 | 186 | | |
167 | 187 | | |
168 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
169 | 203 | | |
170 | 204 | | |
171 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11888 | 11888 | | |
11889 | 11889 | | |
11890 | 11890 | | |
11891 | | - | |
11892 | | - | |
| 11891 | + | |
| 11892 | + | |
| 11893 | + | |
| 11894 | + | |
| 11895 | + | |
11893 | 11896 | | |
11894 | | - | |
11895 | | - | |
11896 | | - | |
| 11897 | + | |
| 11898 | + | |
| 11899 | + | |
| 11900 | + | |
11897 | 11901 | | |
11898 | 11902 | | |
11899 | 11903 | | |
| |||
11903 | 11907 | | |
11904 | 11908 | | |
11905 | 11909 | | |
11906 | | - | |
| 11910 | + | |
11907 | 11911 | | |
11908 | 11912 | | |
11909 | 11913 | | |
| |||
11939 | 11943 | | |
11940 | 11944 | | |
11941 | 11945 | | |
11942 | | - | |
11943 | | - | |
| 11946 | + | |
| 11947 | + | |
| 11948 | + | |
11944 | 11949 | | |
11945 | 11950 | | |
11946 | 11951 | | |
11947 | | - | |
| 11952 | + | |
11948 | 11953 | | |
11949 | 11954 | | |
11950 | | - | |
11951 | | - | |
| 11955 | + | |
| 11956 | + | |
11952 | 11957 | | |
11953 | | - | |
| 11958 | + | |
11954 | 11959 | | |
11955 | | - | |
| 11960 | + | |
11956 | 11961 | | |
11957 | | - | |
| 11962 | + | |
11958 | 11963 | | |
11959 | | - | |
| 11964 | + | |
11960 | 11965 | | |
11961 | | - | |
| 11966 | + | |
11962 | 11967 | | |
11963 | | - | |
| 11968 | + | |
11964 | 11969 | | |
| 11970 | + | |
| 11971 | + | |
| 11972 | + | |
| 11973 | + | |
| 11974 | + | |
| 11975 | + | |
| 11976 | + | |
| 11977 | + | |
| 11978 | + | |
11965 | 11979 | | |
11966 | | - | |
11967 | | - | |
11968 | | - | |
11969 | 11980 | | |
11970 | 11981 | | |
11971 | 11982 | | |
| |||
0 commit comments