summaryrefslogtreecommitdiff
path: root/Userland/Applications/Spreadsheet/SpreadsheetView.cpp
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2022-03-20 12:33:05 +0330
committerLinus Groh <mail@linusgroh.de>2022-03-20 13:20:33 +0000
commit8919e4b2b6c8e88a8d841662a626c19bd0d03cf3 (patch)
treeea1ac77d27d4a420739d35b63fe80b12db15dc03 /Userland/Applications/Spreadsheet/SpreadsheetView.cpp
parent0d302516d521016552333c00f1c5a470b04428eb (diff)
downloadserenity-8919e4b2b6c8e88a8d841662a626c19bd0d03cf3.zip
Spreadsheet: Only update the selection on primary mousedown
Otherwise we'd end up clearing the selected rect before doing anything with it if the user right-clicks on it.
Diffstat (limited to 'Userland/Applications/Spreadsheet/SpreadsheetView.cpp')
-rw-r--r--Userland/Applications/Spreadsheet/SpreadsheetView.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Applications/Spreadsheet/SpreadsheetView.cpp b/Userland/Applications/Spreadsheet/SpreadsheetView.cpp
index 73141a2e25..f37ebd9ef6 100644
--- a/Userland/Applications/Spreadsheet/SpreadsheetView.cpp
+++ b/Userland/Applications/Spreadsheet/SpreadsheetView.cpp
@@ -206,8 +206,10 @@ void InfinitelyScrollableTableView::mousedown_event(GUI::MouseEvent& event)
AbstractTableView::mousedown_event(adjusted_event);
} else {
AbstractTableView::mousedown_event(event);
- auto index = index_at_event_position(event.position());
- AbstractTableView::set_cursor(index, SelectionUpdate::Set);
+ if (event.button() == GUI::Primary) {
+ auto index = index_at_event_position(event.position());
+ AbstractTableView::set_cursor(index, SelectionUpdate::Set);
+ }
}
}