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.
In derivable classes, the widget's class can be different from the one
dispose_template() was called for, which can lead to failing the
template != NULL check at best, undefined behavior at worst.
Since we already pass the correct GType into the function, just use that
instead.
The problem here is that new windows appear in the list before the
window's dispay gets set and we don't update the filter when the
display changes (would need watches support for the filtermodel).
So add this somewhat hacky method.
The split-up of gdksurface-wayland.c introduced a protocol violation
when it didn't make sure xdg_surface was destroyed after the role
objects (xdg_popup / xdg_toplevel). Fix that.
Fixes: 2a463baed0 ("wayland: Rearrange the surface code")
Don't misinform the observing listmodel that CSS nodes were removed that
weren't actually removed, but just moved. Otherwise the observer would
think it has run out of items when it really hasn't.