Re: Only one instance of a capplet should be allowed



Behdad Esfahbod wrote:
  3) Those that there's no reason (other than technical reasons)
to do single-instance.  They typically don't have much shared
configuration/preferences.  Evince may be a good example of this.
Evince is single-instance right now, but that's just the way it
is implemented I guess.  It could have been non-single-instance
and perform quite the same.


There are various reasons, for instnace gedit allows to drag a tab from a window to another. Then there is "document awareness", that is just raise the existing window or warn the second time the same file is opened. Metadata is another reason: both gedit and evince store a file with some metadata about files used (current cursor position, last searched word, etc) which is much easier to manage with a single instance (no locking).

Obviously startup time and memory consumption are other good reasons, though it is still important to make the first instance start fast.


Note however that enforcing a single instance brings its share of problems too, that app authors should be aware of: e.g. apps with more than a window should never use gtk_dialog_run() since it blocks all the windows, not just the one the dialog is modal to.

There are also some UI issues introduced, especially with the interaction with workspaces: should a window be moved from a workspace to another or should workspaces be handled as indipendent? (no, there isn't one true answer :)


Paolo



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