LCL-Gtk2: Fix handling selection of simple listview in icon mode, issue #40563. Based on patch by Anton Kavalenka.

Actually it was a regression after
ed5ff63cf4.


(cherry picked from commit 1c3d963184)
This commit is contained in:
Maxim Ganetsky 2023-10-20 17:38:12 +03:00
parent b332764d30
commit 688188fe5c

View File

@ -367,19 +367,15 @@ var
begin
Widgets := PTVWidgets(WidgetInfo^.UserData);
if Length(Widgets^.ItemCache)=0 then
List := gtk_icon_view_get_selected_items(AIconView);
if (List <> nil) then
begin
List := gtk_icon_view_get_selected_items(AIconView);
if (List <> nil) then
begin
Path := PGtkTreePath(g_list_first(List)^.data);
Indices := gtk_tree_path_get_indices(path)^;
ChangeItemCache(Widgets, Indices, tvisUnselected);
g_list_free(List);
end else
exit;
Path := PGtkTreePath(g_list_first(List)^.data);
Indices := gtk_tree_path_get_indices(path)^;
ChangeItemCache(Widgets, Indices, tvisUnselected);
g_list_free(List);
end else
Exit;
exit;
// LCL already sent selection !
if wwiInvalidEvent in Widgets^.WidgetInfo^.Flags then