Re: GtkApplication and argc/arv



On Thu, 10 Mar 2011 16:47:59 +0100
Murray Cumming <murrayc murrayc com> wrote:
> If it's most programs then surely you can give some example. I don't
> think that most applications have to deal with caching, bookmarks, and
> history like Firefox.

I didn't realise you wanted examples, but most programs that have a
shared resource would fall into this category. For example, my mail
reader (claws), and most other mail readers for that matter apart from
yours, evolution, which I think is server/database based, are single
instance programs (as it happens I have seen complaints that, for any
one user, evolution should be single instance). The messaging
applications I am running, empathy and pidgin, are single instance
programs. (Skype is an example of a poorly designed one which does
start another instance but then complains about it and interferes with
itself: it would have done better to get it right by itself.)

Usually if you start more than one of these you have simply made a
mistake, having forgotten that the program is already running on, say,
another desktop, or it has been launched by mime type rather than by
explicit intention of the user. What you want is for the existing
instance to reappear.  I agree that for things that are simply document
editors like emacs, or viewers like eog, or word processors, one can
reasonably anticipate that the user doesn't give a damn, provided
preferences work correctly (and if more than one instance has opened
the same document, they don't interfere with each other), but that is a
relatively small sub-set of programs.

> I accept that _some_ would have some shared data, and they might
> choose to go single-process to make that easier. But it doesn't seem
> common enough to recommend it generally.

I don't think there is a need to recommend anything.  I suspect that
now that, with GtkApplication, you don't have to write your own dbus
stuff, as I had to do in the past, ease of implementation will
naturally lead to single instance designs. There may well be cases
of multi-document programs where for good reason the programmer decides
not to do it that way, say for address space isolation, provided that
one can reasonably anticipate that different instances will not
interfere with each other and that is programmatically attended to.

I think we should just agree to disagree.  I think this is also
starting to go a little off topic on this particular mailing list.

Chris


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