Re: Linking 'Activities' and recent documents



Le lundi 12 janvier 2009 à 10:09 +0000, Emmanuele Bassi a écrit :
> On Sun, 2009-01-11 at 23:02 +0100, Milan Bouchet-Valat wrote:
> 
> > But the issue of recent documents seems trickier to me, while it would
> > really be nice to have. The idea is that we need to tag a recent
> > document with a metadata like "activity:foo" so that you can show only
> > the documents used in this activity: this would make recent lists more
> > more useful, with documents more likely to be what you're looking for.
> > Think of OpenOffice.org Writer for your "Work" activity showing your
> > last business letter instead of the strange documents you read at home.
> > Or GEdit showing the source files used in gnome-shell rather than that
> > from nautilus you occasionally hacked yesterday.
> 
> the GtkRecentManager stores the applications that have opened a file; it
> also allows more meta-data to be added by using namespaced metadata
> sections -- see the Desktop Bookmark file specification on fd.o:
> 
>   http://www.freedesktop.org/wiki/Specifications/desktop-bookmark-spec
Well, the spec doesn't really tell that we may use custom metadata.
Though, it says they should be ignored so it may allow to insert this
kind of information, yes. That seems a good idea. But this won't be set
using GtkRecentManager, which does not allow this AFAIK.


> > GtkRecentManager could automatically add this information when adding a
> > document to the list, so that a new function allows to select files
> > corresponding to an activity. Though it would require GTK to guess what
> > is the current activity. This cannot really be related to an
> > application, but rather to a window, I think, which makes it quite
> > complex.
> 
> if you add a _NET_WM_CURRENT_ACTIVITY property on the root window then
> gtk+ or gnome-shell can get that information and fill out the meta-data.
> 
> but, seriously: every application that has opened a file and that uses
> the GtkRecentManager API will be stored in the meta-data. this already
> happens.
But only the app name is stored, while we want something like a window ID. Firefox for example will obviously be used for many Activities, and Writer too.
Your proposal using a _NET_WM_CURRENT_ACTIVITY property could be nice to complete the bookmarks after they have been saved. The problem is still: apps won't save their window name in the bookmarks. How can you distinguish between two instances of GEdit running at the same time on two Activities? Or you may assume only one Activity is active (sic) at the one time?

> >  There is a GtkRecentManager for each GdkScreen, but not one for
> > each 'Activity'.
> 
> wrong: there's a GtkRecentManager singleton for each process.
I've just seen the GdkScreen thing is deprecated since 2.12. This
explanation for gtk_recent_manager_new() misled me:
"GtkRecentManager objects are expensive: be sure to create them only when needed. You should use gtk_recent_manager_get_default() instead."
Anyway, this is useless for our matter.

> > Else, a new field in GtkRecentData
> 
> you can't do this. GtkRecentData is public and cannot grow without
> breaking API/ABI.
> 
> >  could be added together with a
> > variant of gtk_recent_manager_add_item() that would allow
> specifiying
> > the activity as an argument, called from applications. Anyway, such
> a
> > change would be nice to standardize among free desktops, and is a
> more
> > long-term approach.
> 
> no other desktop has the "activities" concept; not even GNOME, at this
> point. planning to standardise on something before it's even ready is
> usually the first step towards killing a project.
Sure, that's why I don't really consider this approach. Breaking GTK+
API can be done with 3.0, but for an experimental feature it would be a
little overkilled. And problem with standards if we can add custom
meta-data; I was just unaware of their existence.


Thanks for your reply! I still don't really see how we can circumvent
the problem of making app name and window correspond to add meta-data to
recent documents. Can we simply say: one Activity = one period, and
everything between the start and the end points of the Activity is
considered to be part of it?

Cheers!



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]