Skip to content

Commit 84d2f3a

Browse files
committed
fix: right-click logic was being messed up by a .NET quirk
1 parent 43c2139 commit 84d2f3a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • src/BizHawk.Client.EmuHawk/CustomControls/InputRoll

src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1876,7 +1876,11 @@ private Cell CalculatePointedCell(int x, int y)
18761876
}
18771877
}
18781878

1879-
if (!(IsPaintDown || RightButtonHeld) && newCell.RowIndex <= -1) // -2 if we're entering from the top
1879+
// We don't show the pointed cell as being a column header (RowIndex = null) if we are holding right mouse button. (This allows right-click dragging to rows above the top one.)
1880+
// hack: MouseMove events do not happen while a context menu is open, leading to a column right-click not working if a context menu was already open.
1881+
// we solve this by only considering right button if the prior cell has a row value
1882+
bool rightButton = RightButtonHeld && CurrentCell.RowIndex != null;
1883+
if (!(IsPaintDown || rightButton) && newCell.RowIndex <= -1) // -2 if we're entering from the top
18801884
{
18811885
newCell.RowIndex = null;
18821886
}

0 commit comments

Comments
 (0)