Hi,
I’m using GtkGridView
in a GTK4 app, what I’m trying to achieve is to deselected all selected items when clicking in a place where there’s no item.
Is there any way to achieve this?
Currently, what I can think of is calling Gtk.SelectionModel
unselect_all
on some signal, but I can’t find any signal matching my needs (ie. that fires when clicking outside any item).
In GTK3, Gtk.IconView
had a method get_item_at_pos
which could be used to determine if a click was outside an item, but this method doesn’t seem to be available in Gtk.GridView
in GTK4. I’ve tried using a Gtk.GestureClick
to capture click events and determine the click position, but I’m struggling to find a reliable way to check if the click is indeed outside any items.