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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

xivlauncher: Fix GameMode not being detected #299304

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

drakon64
Copy link

@drakon64 drakon64 commented Mar 26, 2024

Description of changes

Fix XIVLauncher not detecting GameMode.

According to the documentation for the NativeLibrary.TryLoad method and DllImportSearchPath enum (used by XIVLauncher to detect GameMode) the library search path used by .NET is fairly static. As XIVLauncher runs inside of a steam-run wrapper we can add GameMode to the FHS environment so that .NET can detect it.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 馃憤 reaction to pull requests you find important.

@drakon64
Copy link
Author

GameMode GNOME Shell plugin confirms that GameMode is running
image

@drakon64 drakon64 marked this pull request as ready for review March 26, 2024 21:14
@drakon64 drakon64 changed the title xivlauncher: Fix gamemode not being detected xivlauncher: Fix GameMode not being detected Mar 26, 2024
@ofborg ofborg bot requested review from witchof0x20 and sersorrel March 26, 2024 22:14
@drakon64
Copy link
Author

I've created #299524 as a possibly better way of fixing this issue, still a draft PR as I need to test it.

@drakon64
Copy link
Author

I've created #299524 as a possibly better way of fixing this issue, still a draft PR as I need to test it.

I've not made any progress with getting this to work. If the maintainers are fine with this solution, feel free to merge.

Copy link
Contributor

@witchof0x20 witchof0x20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been running an identical override for months and this does work fine. The module approach in the other PR seems a bit complex/messy and I don't feel it's necessary. Have you tested this PR on a system without gamemoded enabled?

@witchof0x20
Copy link
Contributor

As for dependencies, IMO making this dependency optional with a useGamemode argument to the derivation seems appropriate.

@drakon64
Copy link
Author

I've been running an identical override for months and this does work fine. The module approach in the other PR seems a bit complex/messy and I don't feel it's necessary. Have you tested this PR on a system without gamemoded enabled?

Disabling GameMode causes a prompt to appear to give permission to GameMode to do its thing.

image

Unfortunately, this then takes over GNOME Shell and XIVLauncher has to be force-killed in a separate TTY.

@drakon64
Copy link
Author

As for dependencies, IMO making this dependency optional with a useGamemode argument to the derivation seems appropriate.

I've had zero success with getting this to work.

@drakon64
Copy link
Author

I'm continuing to work on making GameMode optional, will test again today hopefully

@drakon64
Copy link
Author

Works with an override now, this PR should be ready for review now

@sersorrel
Copy link
Contributor

observation: enabling this flag without gamemode running system-wide causes a substantial amount of logspam when viewing the settings page, if you have the launcher's gamemode option enabled, along the lines of:

GameMode ERROR: D-Bus error: Could not call method 'RegisterGame' on 'com.feralinteractive.GameMode': The name com.feralinteractive.GameMode was not provided by any .service files
gamemodeauto: D-Bus error: Could not call method 'RegisterGame' on 'com.feralinteractive.GameMode': The name com.feralinteractive.GameMode was not provided by any .service files
GameMode ERROR: D-Bus error: Could not call method 'UnregisterGame' on 'com.feralinteractive.GameMode': The name com.feralinteractive.GameMode was not provided by any .service files
gamemodeauto: D-Bus error: Could not call method 'UnregisterGame' on 'com.feralinteractive.GameMode': The name com.feralinteractive.GameMode was not provided by any .service files

@drakon64
Copy link
Author

drakon64 commented Mar 31, 2024

observation: enabling this flag without gamemode running system-wide causes a substantial amount of logspam when viewing the settings page, if you have the launcher's gamemode option enabled, along the lines of:

GameMode ERROR: D-Bus error: Could not call method 'RegisterGame' on 'com.feralinteractive.GameMode': The name com.feralinteractive.GameMode was not provided by any .service files
gamemodeauto: D-Bus error: Could not call method 'RegisterGame' on 'com.feralinteractive.GameMode': The name com.feralinteractive.GameMode was not provided by any .service files
GameMode ERROR: D-Bus error: Could not call method 'UnregisterGame' on 'com.feralinteractive.GameMode': The name com.feralinteractive.GameMode was not provided by any .service files
gamemodeauto: D-Bus error: Could not call method 'UnregisterGame' on 'com.feralinteractive.GameMode': The name com.feralinteractive.GameMode was not provided by any .service files

This was one of my concerns, enabling GameMode in the package without it being enabled system-wide has some bad effects (see #299304 (comment)).

@drakon64
Copy link
Author

drakon64 commented Apr 1, 2024

I've been thinking about this, and I can't really see a way to avoid someone enabling GameMode within XIVLauncher without it being enabled system-wide.

  • If we move XIVLauncher to a module, the package override will still exist so this issue could still occur
  • We can't check if GameMode is enabled system-wide from within the package (far as I know)

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/3833

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants