From 7134045dcbde7910e85fe37ced7008474e9c2f45 Mon Sep 17 00:00:00 2001 From: cfillion Date: Wed, 14 Feb 2024 06:03:19 -0500 Subject: [PATCH] fix spurious selection when reloading the browser on macOS https://developer.apple.com/documentation/appkit/nstableview/1527288-beginupdates --- src/listview.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/listview.cpp b/src/listview.cpp index 780839a3..5ec6556b 100644 --- a/src/listview.cpp +++ b/src/listview.cpp @@ -315,6 +315,11 @@ void ListView::endEdit() void ListView::clear() { ListView_DeleteAllItems(handle()); +#ifdef __APPLE__ + // NSTableView preverves the previous selection when removing rows after + // beginUpdates is called (via WM_SETREDRAW=0 in SWELL) + unselectAll(); +#endif m_rows.clear(); }