GNOME Bugzilla – Bug 481823
When opening multiple files, Nautilus starts one instance of the application per file
Last modified: 2013-04-24 21:01:40 UTC
Hi, I'm trying to add command line support to one of my applications. What I would actually like would be to be able to open some files from Nautilus with my application. The problem is that the latter starts one instance of my application per selected file. I could actually use, e.g., DBus to detect that my application is already running and pass to it the file received on the command line. However, my application is an audio player, and when opening multiple files, the user typically wants them to be played immediately, and these files should be sorted according to the current sorting criteria. For instance, if I open a directory that contains all the tracks from a given album and if then I select all these files to open them, I expect my application to immediately start playing them *in the right order*, i.e., sorted by track number. How can I do that with the current behavior of Nautilus? I mean, I don't see how to be sure that the first instance will get the first track, so that other instances can simply pass to this one the other files and then stop. IMHO, Nautilus should start only one instance and pass to it all the selected file, don't you think? It should be up to the application to decide how to handle multiple files, not up to Nautilus, because the expected behavior highly depends on the kind of application considered. Other information:
I'd say it's up to your application to use some sort of message bus (eg DBus) to connect to an already running instance and do the right thing. For example if I open 5 files first and then 5 more, nautilus has to start a new instance anyway.
*** Bug 633338 has been marked as a duplicate of this bug. ***
*** Bug 550909 has been marked as a duplicate of this bug. ***
*** Bug 551682 has been marked as a duplicate of this bug. ***
What I understand of comment 0 is that this is actually about opening a selection of files of the same type in a single call, so that, in this case, a media player plays the selection as a playlist. This was dealt with in bug 105653. I tested it with a couple of videos and it works as expeted for both Totem and VLC: a single application instance is launched, selection becomes playlist. *** This bug has been marked as a duplicate of bug 105653 ***