Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync issue: Implement single instance #38

Closed
Letiliel opened this issue Feb 3, 2014 · 8 comments
Closed

Sync issue: Implement single instance #38

Letiliel opened this issue Feb 3, 2014 · 8 comments
Milestone

Comments

@Letiliel
Copy link
Contributor

Letiliel commented Feb 3, 2014

Games won't appear after installing from the web if Lutris was already running.

@strycore
Copy link
Member

strycore commented Feb 3, 2014

yes, that's a though one. The installer opened from the web is another instance that the already running client. The installer would need to notify other instances of the new game with, for example, DBus. And I know nothing about DBus :/

@Letiliel
Copy link
Contributor Author

Letiliel commented Feb 3, 2014

And if you allow only one instance ?

@strycore
Copy link
Member

strycore commented Feb 4, 2014

No. Not going to happen any time soon.

@strycore
Copy link
Member

strycore commented Feb 4, 2014

I mean, it will eventually happen, but when it will, the DBus communication mechanism will be implemented, because I see it as a requirement in order to limit to one instance of the client

@Letiliel
Copy link
Contributor Author

Letiliel commented Feb 6, 2014

Some info and code snippets for what you want to do :
http://lethalman.blogspot.fr/2008/11/single-app-instances-python-and-dbus.html

Otherwise, maybe we could do it the stupid way : create a file when running Lutris, if another instance is launched it checks if the file exists, writes its arguments in it and closes. The first instance then reads the file and treats the args. Like so :

if File exists: 
    write args into File
    end process
else
    create empty File

on_check_File_size_frequently {
    if File.size > 0
        process args
    else
        return
}

on_exit {
    remove File
}

@strycore
Copy link
Member

Thanks for the link! Tried out the demo, works flawlessly. I originally thought that you had to register a DBus service as root, but it's not the case here.
Makes me want to have a deeper look into Dbus, we may have this for Lutris 0.3.5 ;)

@strycore strycore added this to the 0.3.6 milestone Aug 14, 2014
@strycore strycore modified the milestones: 0.3.7, 0.3.6 Oct 17, 2014
@TingPing
Copy link
Contributor

(Note that Gtk has this built in via GtkApplication as used in my PR)

@Letiliel
Copy link
Contributor Author

Argh.
Well, Google, you did a bad job this time.

I'll let @strycore see what he wants to do with that. (Ehh, I suppose the advantage of not using GtkApplication is that it simplifies porting to another toolkit.)

@lutris lutris locked as resolved and limited conversation to collaborators Feb 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants