mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 13:14:17 +01:00
Use game window to calculate offsets in fallback mouse position code
This commit is contained in:
parent
e07bda7e58
commit
201c9cfcf2
1 changed files with 6 additions and 1 deletions
|
|
@ -494,7 +494,12 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
||||||
// (This is the position you can get with ::GetCursorPos() or WM_MOUSEMOVE + ::ClientToScreen(). In theory adding viewport->Pos to a client position would also be the same.)
|
// (This is the position you can get with ::GetCursorPos() or WM_MOUSEMOVE + ::ClientToScreen(). In theory adding viewport->Pos to a client position would also be the same.)
|
||||||
var mousePos = mouseScreenPos;
|
var mousePos = mouseScreenPos;
|
||||||
if ((io.ConfigFlags & ImGuiConfigFlags.ViewportsEnable) == 0)
|
if ((io.ConfigFlags & ImGuiConfigFlags.ViewportsEnable) == 0)
|
||||||
ClientToScreen(focusedWindow, &mousePos);
|
{
|
||||||
|
// Use game window, otherwise, positions are calculated based on the focused window which might not be the game.
|
||||||
|
// Leads to offsets.
|
||||||
|
ClientToScreen(this.hWnd, &mousePos);
|
||||||
|
}
|
||||||
|
|
||||||
io.AddMousePosEvent(mousePos.x, mousePos.y);
|
io.AddMousePosEvent(mousePos.x, mousePos.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue