win32: add support for starting drags#3
Merged
Conversation
a0c95c8 to
ea394ea
Compare
6a79103 to
028230d
Compare
028230d to
b38bcab
Compare
eira-fransham
approved these changes
Jun 4, 2026
eira-fransham
left a comment
There was a problem hiding this comment.
This looks good! Great job here. Thanks for figuring this out. Some small nitpicks but overall this is good to merge.
Drop emitted DragDropped before computing the effect, so a target rejection via set_valid_actions(none()) left the source seeing DROPEFFECT_NONE while the target app had already seen DragDropped. Compute the effect first and route DROPEFFECT_NONE to DragLeft. Also trace effect_out on the source - cross-process drops have no in-process target callback to observe it through.
Standard Arc pattern: Release on decrement publishes, but the dropping thread needs an Acquire fence on the zero transition to see writes another thread made through the object. AddRef drops to Relaxed - a bump on a count you already reference doesn't synchronize anything. Latent today since our COM objects stay in the STA.
Plumb the icon through IDragSourceHelper::InitializeFromBitmap. The shell composites in premultiplied alpha, so convert RGBA to premultiplied BGRA in a top-down DIB or translucent edges get a halo. Helper failures are non-fatal.
b38bcab to
dfd05ae
Compare
The TYMED branch values in `duplicate_stgmedium` were each off by one bit shift: TYMED_FILE was 1 (= HGLOBAL) instead of 2, GDI was 32 instead of 16, MFPICT 64 instead of 32, ENHMF 128 instead of 64. Latent because the shell drag helper only uses HGLOBAL, but a HANDLE-bearing SetData of any other tymed would have either fallen through or aliased the wrong union arm. Use the named TYMED_* constants from windows-sys so we can't drift again.
26cb8a6 to
e35894d
Compare
aurindam
added a commit
to slint-ui/zeiterfassung
that referenced
this pull request
Jun 4, 2026
When a developer rebases or force-pushes, the commit author date stays frozen at the original time, making the day of actual work invisible in the activity view. The committer date reflects when the rebase happened and is the correct timestamp to use for time-tracking purposes. For example, PR slint-ui/winit#3 had commits authored on Jun 2 that were rebased and force-pushed on Jun 3 (committer date 2026-06-03T19:25Z) — without this fix Jun 3 showed no activity despite real work being done. Also re-timestamps already-stored entities when a sync detects the committer date changed, so historical data self-corrects on the next Refresh without requiring a manual DB cleanup. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
| } else if tymed == TYMED_ENHMF { | ||
| out.u.hEnhMetaFile = dup as _; | ||
| } else { | ||
| unreachable!(); |
There was a problem hiding this comment.
Panicking is probably unsound here, just return None. Even if this is never called from a system callback, none of this unsafe code is particularly well-tested.
| Some(out) | ||
| } | ||
|
|
||
| unsafe fn alloc_hglobal_from(src: *const u8, len: usize) -> Option<HGLOBAL> { |
There was a problem hiding this comment.
If you're taking a pointer and length, surely it's better just to take a slice? That way you're sure that the pointer isn't null, too.
Member
Author
There was a problem hiding this comment.
Good idea, that should work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
changelogmodule if knowledge of this change could be valuable to users