Skip to content

Windows: Fix drag mouse position for parented windows (bugfix) - take 2 - #368

Open
AlexCharlton wants to merge 2 commits into
RustAudio:masterfrom
AlexCharlton:win-fix-drag-mouse-position-2
Open

AlexCharlton wants to merge 2 commits into
RustAudio:masterfrom
AlexCharlton:win-fix-drag-mouse-position-2

Conversation

@AlexCharlton

Copy link
Copy Markdown
Contributor

Reprising #253

To summarize from the previous PR: Some hosts (though, the only one I can find that does this is Bitwig) can have drag-n-drop points coming from an OLE process that doesn't share the same coordinate space as the HNDW. Calls to ScreenToClient must be wrapped with calls to PhysicalToLogicalPointForPerMonitorDPI and LogicalToPhysicalPointForPerMonitorDPI to correct this.

This PR adds these wrapper calls, gated on whether or not the window is actually DPI-aware in the first place. This gating is necessary since some hosts (Ableton with "Auto-Scale Plug-In Window" toggled on) can create DPI-unaware windows.

Tested on:

  • Ableton (with "Auto-Scale Plug-In Window" toggled on and off)
  • Bitwig
  • Cubase
  • FL Studio
  • Reaper
  • Unparented

Apply DPI-aware conversion around ScreenToClient in
HWnd::screen_to_client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant