Prechádzať zdrojové kódy

Bug fix: Session tabs cannot be dragged when the user has mouse buttons swapped

Source commit: acfeaadb9265adf86b15ff206bec0b5da824003e
Martin Prikryl 3 rokov pred
rodič
commit
bb4acdec1f
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      source/forms/CustomScpExplorer.cpp

+ 2 - 1
source/forms/CustomScpExplorer.cpp

@@ -10366,7 +10366,8 @@ void __fastcall TCustomScpExplorerForm::SessionsPageControlMouseDown(
       // to actually release the button, "mouse down" is still raised,
       // but we do not get "mouse up" event, so dragging is not cancelled,
       // prevent that by not beginning dragging in the first place.
-      if (IsKeyPressed(VK_LBUTTON))
+      int Key = ((GetSystemMetrics(SM_SWAPBUTTON) == 0) ? VK_LBUTTON : VK_RBUTTON);
+      if (IsKeyPressed(Key))
       {
         // when user clicks the "+", we get mouse down only after the session
         // is closed, when new session tab is already on X:Y, so dragging