springlobby / springlobby

SpringLobby is a free cross-platform lobby client for the Spring RTS project
https://springlobby.springrts.com
GNU General Public License v2.0
81 stars 45 forks source link

Spring executable settings are not persistent #926

Open danuker opened 5 years ago

danuker commented 5 years ago

I am running SL 0.267 on Debian 10 (buster).

I have a somewhat special requirement: I am on a laptop, and I have a Bumblebee configuration (Nvidia GPU + Intel CPU). For this, I need to use the optirun command for any GPU application:

Just spring uses the Intel integrated GPU (not very good), but when I run optirun spring, it actually uses the GPU like it's supposed to.

So, I created a script called spring-optirun.sh which does just that, and forwards the shell parameters: optirun spring "$@". I then configured it from Edit -> Preferences.

However, the bug in SpringLobby is that every time I restart the lobby, these settings are lost, and the executable is reverted from spring-optirun.sh to spring for each version of the engine I have (as if I clicked the "Auto Configure" button, which I did not click).


Second suggestion (please ask me to split the ticket if you want): the "Spring" configuration of engine and library paths should definitely be under Edit -> Spring Settings, not Edit -> Preferences. It was hard to find it the first time.

danuker commented 5 years ago

I traced it to line 212 in utils/slpaths.cpp:

https://github.com/springlobby/springlobby/blob/cbb608c33b2158b6d0ec0437746bd10ca1f3637c/src/utils/slpaths.cpp#L212

But commenting it out leaves the path entirely blank. Will investigate further.

abma commented 5 years ago

thats by intention. you could rename spring to spring.orig and rename spring-optirun.sh to spring

danuker commented 5 years ago

By intention? Would a user want the paths to auto-configure every time the lobby loads?

danuker commented 5 years ago

I see that before this call, while the lobby is loading, the setting I want is loaded at some point(SetSpringBinary in springlobbyapp.cpp)

danuker commented 5 years ago

Bah, I am too tired now. Thanks for the workaround, but wouldn't you accept a pull request fixing this?

danuker commented 5 years ago

Another idea: When the path should not be editable (since it's designed to regenerate the paths), use a read-only text control. But when would that be?

abma commented 5 years ago

Another idea: When the path should not be editable (since it's designed to regenerate the paths), use a read-only text control. But when would that be?

yeah, a read-only control reflect how its meant to be used.