Async callbacks are delivered in idles, so we need to make sure
we get the gdk lock before calling any gdk/gtk stuff. This was
missing in a few places.
Since the ::changed implementation of GtkRecentManager implies a
synchronous write operation, when we receive multiple requests to emit a
::changed signal we might end up blocking.
This change coalesces multiple ::changed emission requests using the
following sequence:
• the first request will install a timeout in 250 ms, which will
emit the ::changed signal
• each further request while the timeout has not been emitted
will increase a counter
‣ if the counter reaches 250 before the timeout has been
emitted, then the RecentManager will remove the timeout
source and force a signal emission and reset the counter
This sequence should guarantee that frequent ::changed emission requests
are coalesced, and also guarantee that we don't let them dangle for too
long.
https://bugzilla.gnome.org/show_bug.cgi?id=616997
The gtkprivate.h header contains GtkWidget-specific private symbols that
are not useful except in a handful of cases. Basically everything
includes gtkprivate.h for the GTK_PARAM_* macros.
https://bugzilla.gnome.org/show_bug.cgi?id=632539
The :limit property of GtkRecentManager does not serve any useful
purpose: the length of the list should be managed by the view
(implementing GtkRecentChooser), and not by the model (the recent
manager).
https://bugzilla.gnome.org/show_bug.cgi?id=624333
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API
https://bugzilla.gnome.org/show_bug.cgi?id=610474
The Gtk-custom.c file in gir-repository contained a number of
introspection annotations. Merge those into the GTK source files.
Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.
The documentation for the function says that the app_exec string
should be freed, but we return a pointer to the internal string
without duplicating it. Since the app_exec string is valid as long
as the GtkRecentInfo is valid the documentation should be fixed
and the out argument should be constified. Fixes#584832.
2008-08-07 Emmanuele Bassi <ebassi@gnome.org>
Bug 545031 – list of recently used files is created world-readable
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_real_changed): Set the recently-used.xbel
file to 0600. (Guido Berhoerster)
svn path=/trunk/; revision=21028
2008-07-21 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c:
(recent_app_info_new), (recent_app_info_free): Use GSlice to
allocate the application data for recently used resources;
do not call time() to initialize the timestamp, as it will
be overwritten anyway later. (#535223, Michael Meeks)
svn path=/trunk/; revision=20884
2008-06-30 Cody Russell <bratsche@gnome.org>
* Practically everything changed.
Change all references of GIMP Toolkit (and variations of it)
to GTK+ Toolkit, showing no mercy at all to our beloved
ancestry. (#540529)
svn path=/trunk/; revision=20709
2008-06-17 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_remove_item),
(gtk_recent_manager_move_item): Increase the consistency of the
errors returned by GtkRecentManager. (Paolo Borelli)
svn path=/trunk/; revision=20424
2008-06-17 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_remove_item): Consistently use the same
error when removing a URI from an empty GtkRecentManager.
svn path=/trunk/; revision=20422
2008-05-31 Emmanuele Bassi <ebassi@gnome.org>
Bug 535830 – wrong content type adding an item
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_add_item_query_info): Use the correct API
for retrieving the fast MIME type of a URI. (Carlos Garcia
Campos)
svn path=/trunk/; revision=20262
2008-04-18 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_set_filename): Keep the default storage
file in $HOME, as we don't have a migration code in place yet.
svn path=/trunk/; revision=20020
2008-04-18 Michael Natterer <mitch@imendio.com>
* gtk/gtkrecentmanager.c (gtk_recent_manager_clamp_to_age):
g_strfreev() the uris returned by g_bookmark_file_get_uris().
svn path=/trunk/; revision=20019
2008-04-15 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_real_changed): Fix last commit, and
complete the gtk-recent-files-max-age semantics: if the
property is set to 0 then purge the list.
svn path=/trunk/; revision=20007
2008-04-15 Emmanuele Bassi <ebassi@gnome.org>
Bug 488507 – boundless growth of .recently-used.xbel file
slows down applications
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_init),
(gtk_recent_manager_real_changed),
(gtk_recent_manager_set_filename),
(gtk_recent_manager_clamp_to_age): Clamp the recently
used resources list by the age of its items, using
the newly added GtkSettings property.
* gtk/gtksettings.c (gtk_settings_class_init): Add the
gtk-recent-files-max-age property, controlling the
maximum age of the items in the recently used resources
list.
svn path=/trunk/; revision=20006
2008-04-15 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_add_item_query_info),
(gtk_recent_manager_add_item): Emit the ::changed signal
at the end of the asynchronous MIME type query.
svn path=/trunk/; revision=20005
2008-04-15 Emmanuele Bassi <ebassi@gnome.org>
Bug 487375 – gtkrecent apps poll ~/.recently-used.xbel
every 5 seconds
* gtk/gtkrecentmanager.c: Use GFileMonitor to check for
changes in the recently used resources storage file, and
drop the timeout-based poll.
* ChangeLog: Fix attribution of the patch of the previous
commit.
svn path=/trunk/; revision=20004
2008-04-15 Emmanuele Bassi <ebassi@gnome.org>
Bug 506062 – gtk_recent_manager_add_item does not detect mime
type on Windows
* configure.in: Depend on gio-2.0
* gtk/gtkrecentmanager.c:
(gtk_recent_manager_add_item_query_info_cb),
(gtk_recent_manager_add_item): Use GIO to (asynchronously) query
the MIME type of the passed URI.
svn path=/trunk/; revision=20003
2007-10-10 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c (gtk_recent_info_get_icon): Document
that you need to unref the returned GdkPixbuf. (#484132,
Christian Persch)
(build_recent_info): Use g_slist_prepend() when building
the applications list.
svn path=/trunk/; revision=18904
2007-09-03 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c
(gtk_recent_manager_poll_timeout): Remove the stat() time barrier,
as it seems to cause bug #463907 (thanks to Sebastien Bacher).
svn path=/trunk/; revision=18713
2007-07-20 Matthias Clasen <mclasen@redhat.com>
Apply a patch by Emmanuele Bassi to limit the number
of shown recent files. (#439715)
* gtk/gtksettings.c: Add a setting for the number
of recent files to display by default.
* gtk/gtkrecentchooserdefault.c:
* gtk/gtkfilechooserdefault.c: Respect the limit.
* gtk/gtkrecentmanager.c: Remove the poll timeout in
dispose, and do not stat more often than every 5 seconds.
* gtk/gtkrecentchooserutils.c:
* gtk/gtkrecentchoosermenu.c: Cleanups
* tests/testrecentchoosermenu.c: Test limits.
svn path=/trunk/; revision=18510
2007-06-29 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c (get_icon_for_mime_type): Do not
cache the icon pixbufs but rely on the GtkIconTheme not to
hit the disk cache too much (should tentatively fix#426987).
svn path=/trunk/; revision=18288
2007-06-25 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c:
(build_recent_info): building a GtkRecentInfo can never fail.
(gtk_recent_manager_get_items): Clamp the list while building
it so we don't need to traverse it more than once. (#446532,
Philip Withnall)
svn path=/trunk/; revision=18228
2007-06-19 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c: Use g_timeout_add_seconds_full() for
the timed poll of the storage file, since we are using multiple
seconds intervals and we don't actually care about millisecond
precision.
(threads_dispatch), (threads_free), (gtk_recent_manager_init),
(gtk_recent_manager_set_filename): Roll our own version of
gdk_threads_add_timeout() using g_timeout_add_seconds_full()
while holding the GDK main lock.
svn path=/trunk/; revision=18185
2007-06-19 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c: Use a static variable to hold the
singleton and remove the code that binds a recent manager to
a GdkScreen.
(gtk_recent_manager_set_screen): Make it a NOOP.
(gtk_recent_manager_get_for_screen): Proxy for
gtk_recent_manager_get_default().
* gtk/gtk.symbols:
* gtk/gtkrecentmanager.h: Deprecate gtk_recent_manager_set_screen()
and gtk_recent_manager_get_for_screen().
* gtk/gtkmain.c: Force a synchronisation of the GtkRecentManager
singleton (if any) when reaching main loop depth of 0.
* gtk/gtkrecentchooserdefault.c:
(gtk_recent_chooser_default_dispose): Disconnect the changed
signal only if we have a manager and we are connected to it.
(set_recent_manager): Ditto.
* README.in: Document the deprecations.
svn path=/trunk/; revision=18184