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

fps_only shows FPS counter multiple times #1236

Closed
jon4hz opened this issue Feb 14, 2024 · 5 comments · Fixed by #1312
Closed

fps_only shows FPS counter multiple times #1236

jon4hz opened this issue Feb 14, 2024 · 5 comments · Fixed by #1312
Assignees

Comments

@jon4hz
Copy link

jon4hz commented Feb 14, 2024

Describe the bug

When using the fps_only option, the fps counter is displayed three times instead of once. And when I reload the config using Shift_L+F4 it just adds another FPS counter. So if I reload the config twice, I end up with five fps counters.

List relevant hardware/software information

  • Linux Distribution: EndeavourOS
  • MangoHud version: v0.7.1
  • GPU: radeon rx 7900 xtx

To Reproduce
Steam Launch Command: env MANGOHUD=1 MANGOHUD_CONFIG=fps_only=1 %command%

Expected behavior
The fps counter should be displayed only once.

Screenshots

image

after one reload:

image

@gort818
Copy link
Collaborator

gort818 commented Feb 29, 2024

Thanks for the issue, I can confirm. I will look into it.

@gort818 gort818 self-assigned this Feb 29, 2024
@gort818
Copy link
Collaborator

gort818 commented Feb 29, 2024

I guess the easiest way is to check if fps_only is enabled and do not do a reload.
Is there any reason or are reloading the config when you are using fps_only ?

@jon4hz
Copy link
Author

jon4hz commented Feb 29, 2024

I'm quite new to mangohud so I might not see certain use cases for the reload. But I didn't do the reload to do an actual reload - but only to play around and test how mangohud behaves.

Maybe a reload could be useful, if you use a config file to control mangohud and want to switch from fps_only to another display option without having to restart the entire game.

@Dr-Voctor
Copy link

Dr-Voctor commented Apr 14, 2024

I think I'm having the same issue when launching games with Heroic. For my config I have MANGOHUD_CONFIG=fps_limit=100,fps_only,vsync=0,gl_vsync=-1 in /etc/environment, and all games launch with three FPS counters right from the get-go, no need to Shift_L+F4 even. Steam games are fine, one game I tested with only displays the counter once.
Linux distro: Kubuntu
Mangohud version: 0.7.1
GPU: radeon RX 6800 XT

Edit: tested with one more Steam game, had the same issue. Difference between them was that game 1 was linux-native (Total War Warhammer 3) and game 2 was windows-native (Ready or Not)

@zaps166
Copy link
Contributor

zaps166 commented Apr 29, 2024

Generally it duplicates items when legacy_layout is disabled, this should fix the issue:

diff --git a/src/overlay_params.cpp b/src/overlay_params.cpp
index caa4202..82ad23c 100644
--- a/src/overlay_params.cpp
+++ b/src/overlay_params.cpp
@@ -976,6 +976,7 @@ parse_overlay_config(struct overlay_params *params,
    if (params->enabled[OVERLAY_PARAM_ENABLED_legacy_layout]) {
       HUDElements.legacy_elements();
    } else {
+      HUDElements.ordered_functions.clear();
       for (auto& option : HUDElements.options) {
          HUDElements.sort_elements(option);
       }

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

Successfully merging a pull request may close this issue.

4 participants