pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

Qt/ImGui: Fix settings not syncing from FullscreenUI to Qt widgets

Open SternXD opened this issue 6 months ago • 1 comments

Fixes #12750

https://github.com/user-attachments/assets/72ab268b-33d6-45a4-b79c-810fc1600c98

Description of Changes

Enables two-way synchronization of settings between the ImGui FullscreenUI and the Qt settings dialogs:

  1. Adds a new notification entry point in Host (OnSettingsChangedExternally) and calls it from FullscreenUI.
  2. Exposes and wires up Qt handlers to refresh every settings widget when that notification fires.

Rationale behind Changes

The existing settings system had one-way communication: Qt UI changes would reflect in FSUI, but FSUI changes would not reflect back to Qt UI widgets. This created an inconsistent user experience where:

  • Changing "Maximum Frame Latency" from 2 to 3 in Qt immediately showed in FSUI
  • Changing "Maximum Frame Latency" from 2 to 3 in FSUI did NOT show in Qt
  1. New Host Notification System
  • Added Host::OnSettingsChangedExternally() notification entry point in QtHost.cpp
  • This function runs on the UI thread and notifies the settings window of external changes
  1. FullscreenUI Integration
  • FullscreenUI setting change handlers now invoke the new notification system
  • Ensures Qt widgets are refreshed whenever settings change in FullscreenUI
  1. Qt Widget Auto-Refresh
  • Connected all settings widgets to the externalSettingsChanged signal
  • Each widget now automatically refreshes its state when external changes occur
  • Added refresh logic for each settings page:

Suggested Testing Steps

  1. Open both UIs:

    • Launch PCSX2 and open a Qt settings window (e.g., Emulation settings)
    • Go into FSUI
  2. Test FSUI -> Qt sync:

    • Change a setting in FSUI (e.g., "Maximum Frame Latency" from default to a different value)
    • Verify the Qt settings window automatically updates to show the new value
  3. Test Qt -> FSUI sync (already working):

    • Change a setting in Qt UI
    • Verify FSUI shows the updated value
  4. Test multiple settings:

    • Repeat with other settings like vsync, aspect ratio, etc.
    • Verify bidirectional sync works for all tested settings

Did you use AI to help find, test, or implement this issue or feature?

I did not use it for my code but it did help me with grammar and better helping understand why this should be added

SternXD avatar May 30 '25 05:05 SternXD

~~Didn't realize I needed to add a stub to StubHost.cpp will do that tomorrow and should fix cmake issues. Then as Tellow recommended I'm going to start trying to add a reload function to call to update the widgets in place. Instead of reloading the Qt settings windows like that.~~ All done :)

SternXD avatar May 30 '25 06:05 SternXD

It looks like the Output Volume in the FSUI fails to sync with the slider in Qt's Audio tab.

TheTechnician27 avatar Jul 03 '25 15:07 TheTechnician27

Hmm... I'll take a look

SternXD avatar Jul 03 '25 15:07 SternXD

Alright I am going to fix all of them apparently I forgot to make it to where all the settings synced. I'll start later

SternXD avatar Jul 03 '25 17:07 SternXD

I'm honestly just going to redo this now that I have more experience with the PCSX2 repo structure

SternXD avatar Aug 31 '25 17:08 SternXD