FontColSel: Fix CRITICAL/dedup/cosmetics/iterators
commit bc91f40cf27c657c9b3352c80504738004f086c3 (HEAD -> djb_FontCollectionSelector_cleanup_critical, dboles/djb_FontCollectionSelector_cleanup_critical)
Author: Daniel Boles <dboles.src+inkscape@gmail.com>
Date: Fri Oct 13 10:26:59 2023 +0100
FontColSel: Fix dodgy iterator usage for gtkmm 4 &
make stuff private that can be.
gtkmm 4 makes const_iterator a different type as per previous commits.
Also, it stops Row being a subclass of Iter, revealing that some of our
overly complex usage of iterators/rows was unnecessary & breaks on GTK4
– such as derefing 2x (i.e. to Row, then trying to use Row as an Iter).
commit d49e0aa73bba4d927a71ca06162eb00c7f93af93
Author: Daniel Boles <dboles.src+inkscape@gmail.com>
Date: Thu Oct 12 16:19:49 2023 +0100
FontCollectionSelector: Fix Gtk-CRITICAL @ dropped
get_path_at_pos() expects coordinates relative to the bin window, but we
were passing those from ::drag-data-received which are in the widget
space. So we might have been concluding the wrong path in some cases.
Before and after fixing that by converting the coords, we got this:
Gtk-CRITICAL **: 16:06:57.033: gtk_tree_model_get_iter: assertion 'path->depth > 0' failed
This seems not to stop dropping working, but of course it looks bad in
the console. So this commit checks if get_path_at_pos() succeeded, and
if not we exit without trying to convert to an iter, avoiding the noise.
commit 4150951e1441eef351b5ae318bf22d5f36833fec
Author: Daniel Boles <dboles.src+inkscape@gmail.com>
Date: Thu Oct 12 15:53:05 2023 +0100
FontColSel: Dedup if/else branches, more cosmetics
Move repeated code to after the if/else, assign bool more simply, and
make is_system const in the resulting one copy of the mentioned code.
Move some variables to where they are used, not earlier. Delete the
unused local variable `system_collections`, saving that vector copy.
Finally, fix the C++20 warning about lambda capturing this via [=].
Edited by Daniel Boles