repair mouse events

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2020-03-25 21:22:34 +03:00
parent 4b1c81b7f9
commit 6db46bffc3

View File

@ -207,6 +207,7 @@ EFI_STATUS XPointer::CheckMouseEvent(REFIT_MENU_SCREEN *Screen)
}
EFI_STATUS Status = EFI_TIMEOUT;
Screen->mAction = ActionNone;
bool Move = false;
if (!IsDragging && MouseEvent == MouseMove)
MouseEvent = NoEvents;
@ -218,6 +219,7 @@ EFI_STATUS XPointer::CheckMouseEvent(REFIT_MENU_SCREEN *Screen)
Screen->mAction = ActionScrollDown;
else if (MouseInRect(&Scrollbar) && MouseEvent == LeftMouseDown) {
IsDragging = TRUE;
Move = true;
// Screen->mAction = ActionMoveScrollbar;
ScrollbarYMovement = 0;
ScrollbarOldPointerPlace.XPos = ScrollbarNewPointerPlace.XPos = newPlace.XPos;
@ -225,6 +227,7 @@ EFI_STATUS XPointer::CheckMouseEvent(REFIT_MENU_SCREEN *Screen)
}
else if (IsDragging && MouseEvent == LeftClick) {
IsDragging = FALSE;
Move = true;
// Screen->mAction = ActionMoveScrollbar;
}
else if (IsDragging && MouseEvent == MouseMove) {
@ -246,7 +249,8 @@ EFI_STATUS XPointer::CheckMouseEvent(REFIT_MENU_SCREEN *Screen)
else if (MouseEvent == ScrollUp) {
Screen->mAction = ActionScrollUp;
}
else {
}
if (!Screen->ScrollEnabled || (Screen->mAction == ActionNone && !Move) ) {
for (UINTN EntryId = 0; EntryId < Screen->Entries.size(); EntryId++) {
if (MouseInRect(&(Screen->Entries[EntryId].Place))) {
switch (MouseEvent) {
@ -298,7 +302,7 @@ EFI_STATUS XPointer::CheckMouseEvent(REFIT_MENU_SCREEN *Screen)
Screen->mItemID = 0xFFFF;
}
}
}
}
if (Screen->mAction != ActionNone) {