If the `GtkRecentInfo` represents a directory, simply use it, and
do not try to find its parent in `_gtk_file_chooser_extract_recent_folders()`.
For example, there is an entry in my recently-used database
from the Amberol music player about the folder I have opened
with it, but the folder is not listed on the "Recent" tab of
the file chooser widget, only its parent. After this change,
the directory itself is shown.
Native widgets get allocated via their surface,
so can skip them here. This avoids criticals when
re-mapping a popover for the second time, as can
be seen e.g. in the 'Selections' demo in gtk4-demo.
allocate() should not be calling into ensure_allocate(), they do a similar job.
In the end, the code does the same work, but it should be easier to follow now.
Currently the GtkSearchEngine is torn down every time the search
is stopped, which also means between typed characters. This
prevents any of the optimizations that the GtkSearchEngine can
do in the long run.
Let the GtkSearchEngine stay around for longer, and only be
disposed after search is cancelled, the filechooser moves
onto a different mode than search, or is otherwise unmapped/disposed.
While at it, remove an unused struct field.
Again on massive filesystems, the very first character
is likely to bring a likewise massive amount of search
results that we need to maybe query info for, then create
icons and widgets for. While it's impressive we can do
that, it's also expensive and likely pointless, for the
first character.
Typing a second character is however very likely to
considerably reduce the amount of items to categorize and
show. So start actually searching from there.
Testing on a filesystem with 1434099 files indexed, trying 5
semi-random 1 character searches (n, h, t, i, o) returns on
average 168K items (min. 78771, max. 331471), trying 5
semi-random 2 character searches (no, he, th, in, on)
returns on average 34K items (min. 11133, max. 94961),
which is a more approachable set.
Doing this is enough that typing on a filechooser search
entry feels completely fluid.
The search provider should make it sure there are some
specific GFileInfo fields set. Fix the mimetype extraction
from the query, and use that to fill in the missing gaps
the best we can.
When starting a search over a very populated filesystem, it
is possible that typing the first chars will return a too
high number of results. Even though iterating through the
cursor is in itself very fast, extracting the GIO information
from those many files at once is not going to be as fast.
In order to increase interactivity (i.e. not make things
possibly sluggish) iterate the cursor in an idle function
and add search results to the filechooser model little by little.
If the user keeps typing (as it is likely will happen), there
will be better chances to cancel and proceed to the next
query timely. If not, the results will be there soon enough.
Error out if introspection is requested,
but g-ir-scanner isn't found.
And if introspection isn't explicitly disabled
but is required for building the docs, build it.
As fancy as property paths are, recursive resolution of files
to a location increases the big O complexity enough that it's
not a great option on large homedirs with many indexed files.
Ensure the files are from the right location through a URI
prefix match, which does hits an index. This may dramatically
improve performance on large indexed trees.
Testing this query in an isolated testcase with a total
1434099 indexed files shows that it can run more than 1500 times
per second in this computer (an average of 15200 queries in
several 10 second runs), which presumably is a tad faster than
anyone can type.
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4133
In certain scenarios, address the issue where gnome.compile_resources
fails to transmit the present source directory. This is most notably
visible with MSBuild.
width-request already ensures it's above the minimum width, so avoid an
extra queue_resize() when setting size request to (-1, -1).
This is the same way as GtkDropDown works. This also unbreaks
GtkComboBox after the recent allocation fix in
75a417e337.
Incidentally, this also makes GtkComboBox actually resize its popup as
intended (that was broken before).
I don't think this is ultimately the final fix, sometimes I still get
allocation warnings. But the proper fix will probably involve changing
some more allocation machinery around popovers. This is good enough for
now.
All the other signal handlers are connected in
realize and disconnected in unrealize, but the
::compute-size handler was forgotten.
This was notices in !5597.
The current definitions of the g_io_module_*() symbols do not build on
Visual Studio when building against GLib earlier than 2.75.0 due to the
way how these symbols are decorated in the GLib headers, as Visual Studio
does not allow symbols that were previously marked with 'extern' (or so)
to be marked with anything that is symantically different later.
As a result, if we are using Visual Studio and glib-2.74.x or earlier,
override _GLIB_EXTERN as appropriate in the modules/media sources before
including the GIO headers. This sadly, means that we need a
configure-time check as it would have been too late if we checked the
GLib version using G_VERSION_CHECK macro, as the GIO headers would have
been included already.
There are similar items in the print backends, but we will not attempt
to update these files as they are not meant to be built for Windows.