BR: TreeView drag and drop not working properly

Hey there,

I think I might have found a bug in JUCE’s TreeView component.

In a multi monitor setup, when dragging a tree item on a screen that’s not the main monitor, the semi-translucent snapshot of the item still appears on the main monitor.

It’s only reproducible in plugins, not standalones, which is why I created a small demo project: GitHub - ChrsBr/juce_treeview_bug

This is a Windows only problem (works fine on macOS) and it’s not related to HiDPI settings. I was able to track it down to following commit: fc76e93

In DragAndDropContainer::DragImageComponent::setNewScreenPos() the function Displays::logicalToPhysical() is used to get the physical pixel position. Further down the callstack this uses display->topLeftPhysical.getX()) to do the conversion. As far as I can tell this value is only set via Displays::updateToLogical(), which is called during start up for standalone applications but not for plugins, as it seems.

Hope this helps!

Thanks for reporting, that’s fixed here:

1 Like