summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/GTableView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibGUI/GTableView.cpp')
-rw-r--r--Libraries/LibGUI/GTableView.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Libraries/LibGUI/GTableView.cpp b/Libraries/LibGUI/GTableView.cpp
index 3c61464c42..46fcb17700 100644
--- a/Libraries/LibGUI/GTableView.cpp
+++ b/Libraries/LibGUI/GTableView.cpp
@@ -517,12 +517,12 @@ void GTableView::context_menu_event(GContextMenuEvent& event)
}
auto index = index_at_event_position(event.position());
- if (!index.is_valid())
- return;
- dbgprintf("context menu requested for index (%d,%d) '%s'\n", index.row(), index.column(), model()->data(index).to_string().characters());
-
- selection().set(index);
- update();
+ if (index.is_valid()) {
+ if (!selection().contains(index))
+ selection().set(index);
+ } else {
+ selection().clear();
+ }
if (on_context_menu_request)
on_context_menu_request(index, event);
}