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

PerformanceMetrics: Allow users to move overlays #13330

Conversation

Dentomologist
Copy link
Contributor

Allow users to move the FPS, VPS, Speed, and Performance Graph overlays.

moved_overlays

Allow users to move the FPS, VPS, Speed, and Performance Graph overlays.
@JMC47
Copy link
Contributor

JMC47 commented Feb 3, 2025

Yeah, seems like a good idea to me. Does this save their positions? Does it behave well with window resizing? I don't think saving positions is necessary or anything, just curious at a glance.

Copy link
Contributor

@iwubcode iwubcode left a comment

Choose a reason for hiding this comment

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

LGTM. Untested.

@Dentomologist
Copy link
Contributor Author

Dentomologist commented Feb 4, 2025

Saving is handled by #13331.

As it stands, overlays can go mostly off-screen the same way the Statistics windows currently do on master by either dragging the overlay or shrinking the render window, though ImGui will move them if needed so at least part of them is always visible.

I've been experimenting with a couple alternate ways of handling overlays going off-screen. The first is that when the user drags an overlay it gets clamped to the window, and anytime the render window changes size it automatically resets the layout to the default. This makes resetting the layout easy, but anybody who needs to change resolutions frequently (say, if their max full-speed resolution is different for different games) would lose out on the benefits of saving the layout once #13331 is merged.

The other option also clamps moving overlays to the render window, but when the window is resized it scales the position of the overlays so they end up in the same relative position. I think this would be a more ideal solution, but the way ImGui handles overlay positions when shrinking the window is finicky and I haven't gotten it to work reliably yet.

@iwubcode
Copy link
Contributor

iwubcode commented Feb 4, 2025

I'd be careful on how we handle that and see if imgui has any suggestions on how to solve it, so that we can be future proof. Related is that imgui has been working on supporting docking/viewports:

34685569-16309c5e-f4a9-11e7-9147-3dc23e083437

So dragging an imgui render window outside of the render area would actually create a new os window. Very cool. I'm eagerly waiting on this and the docking support (supposedly we could move to that branch which is quite stable but I didn't know how maintainers would feel about that...).

A clamp based approach, as long as it's not some generic approach to all imgui windows, should work with my future plans.

Copy link
Member

@dreamsyntax dreamsyntax 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 wanting this for a while!
Did a brief test. Works great, including what you mentioned about the offscreen case, even on HiDPI scenario on linux.

@AdmiralCurtiss AdmiralCurtiss merged commit 05f217b into dolphin-emu:master Feb 6, 2025
13 checks passed
@Dentomologist Dentomologist deleted the performancemetrics_allow_moving_overlays branch February 6, 2025 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants