Drag Adorner at wrong position on High DPI screens
See original GitHub issueDescription
When dragging an item from a ListBox the dragged item is shown at a wrong position offset to the lower right. This only occurs on a High DPI screens such as Notebooks.
Repro This can be reproduced with the simplest of all programs:
<Window x:Class="DragItemScreenPositionIssue.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<ListBox dd:DragDrop.IsDropTarget="True" dd:DragDrop.IsDragSource="True"
dd:DragDrop.UseDefaultEffectDataTemplate="True" dd:DragDrop.UseDefaultDragAdorner="True">
<ListBoxItem>ListBox Item #1</ListBoxItem>
<ListBoxItem>ListBox Item #2</ListBoxItem>
<ListBoxItem>ListBox Item #3</ListBoxItem>
</ListBox>
</Grid>
</Window>
Versions It is a regression between release 2.3.2 and 2.4.0. Tested with .NET Framework 4.8 and 4.5.2 (to rule out fix for issue #363).
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
HorizontalOffset goes in the wrong direction for High DPI ...
<summary> /// Handles drags that go "outside" the screen and returns the mouse delta from the last mouse position. /// When the user...
Read more >DPI Aware UltraDockManager - Forums
The behavior of the splitter drag indicator being rendered in the wrong location is an issue that has already been address.
Read more >Windows scaling issues for high-DPI devices
Discusses Windows scaling issues for high-DPI devices. Provides resolutions and workarounds for various scenarios.
Read more >Drag and Drop Items in a WPF ListView
April 13, 2007 - Fixed a minor issue with the positioning of the drag adorner. The adorner used to "snap" into position, such...
Read more >Mouse input in some games is incorrectly scaled on high- ...
This article describes how to work around an issue in which mouse input in some games is incorrectly scaled on high-DPI devices.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@angus42 I found a solution. Hopefully it’s working without any issue with the GetCurrentPos…
Agreed that using the path without the Canvas is better XAML. Still had to do a little scale transformation by 50% even with the Stretch=“Uniform”. But with that and the develop branch it now works under all situations I can come up with. Thx.