summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Host.cpp
AgeCommit message (Collapse)Author
2026-04-17Improve usage of std::move and const references parametersMartino Fontana
Accomplished using `run-clang-tidy` with `performance-move-const-arg,performance-unnecessary-value-param,modernize-pass-by-value`. Changed arguments to const references, removed them where inappropriate (e.g. sink parameters). Same with std::move. Manually reviewed each change to make sure that it makes sense, and do something more appropriate if possible.
2026-01-25Remove unused importsMartino Fontana
Yellow squiggly lines begone! Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes. If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed. The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports. Not everything is removed, but the cleanup should be substantial enough. Because this done on Linux, code that isn't used on it is mostly untouched. (Hopefully no open PR is depending on these imports...)
2025-11-10Core: Let any thread call previously host-thread-only functionsJosJuice
By letting threads other than the host thread use things like CPUThreadGuard, we can do a significant cleanup in AchievementsManager in a later commit of this pull request. Note: Some functions still can't be called from the CPU thread (or threads the CPU thread might block on, like the GPU thread), but can be called from any other thread.
2025-10-26FifoManager: Remove redundant PauseAndLock parametersDentomologist
PauseAndLock was only called with do_lock=true, and the function only used unpauseOnUnlock when do_lock was false.
2025-10-26FifoManager: Extract RestoreState from PauseAndLockDentomologist
Replace calls of FifoManager::PauseAndLock(do_lock=false) with new function RestoreState for clarity.
2025-08-03Host: Remove outdated commentDentomologist
Host_RequestFullscreen and Host_UpdateMainFrame have been removed, and Host_RequestRenderWindowSize has been used by DolphinQt since 80699096 and by Android since e8739156.
2025-08-03Host: Remove unnecessary functionsDentomologist
Remove Host_RefreshDSPDebuggerWindow (which hasn't done anything since DolphinWX was removed in 44b22c90) and DSP::Host::UpdateDebugger (which only called Host_RefreshDSPDebuggerWindow).
2025-08-03Host: Remove unnecessary functionDentomologist
Remove Host_UpdateMainFrame(). The only non-empty call happened in DolphinNoGUI which called s_update_main_frame_event.Set(), but DolphinNoGUI never waits on that event.
2025-03-23DolphinQt: Fix unresponsive hotkeys during framestep overlay moveDentomologist
Fix the following bug: * Have a moveable ImGui overlay enabled, such as the Statistics window. * Pause the game. * Click and hold on the overlay's title bar as if you were going to move it. Because the screen isn't updating while the game is paused, you won't be able to actually move the overlay. * Press the Frame Advance hotkey several times until it stops responding. At this point emulation hotkeys are no longer responsive. This can be resolved by selecting Play from the toolbar or menu, or selecting Frame Advance from the menu a couple times, but it's annoying and not obvious what's gone wrong or how to fix it. Why the bug is happening: * Doing a framestep while clicking on the overlay title bar causes ImGui to set IO.WantCaptureKeyboard to true, indicating that ImGui is requesting Dolphin ignore any keyboard events while the overlay is being interacted with. * Dolphin complies with this request, causing Host_UIBlocksControllerState to return true and thus setting the input gate to ignore input. * IO.WantCaptureKeyboard is only updated when ImGui::NewFrame() is called, which only happens at the end of each present. It thus remains true indefinitely since the game paused after the last framestep, and so Dolphin ignores any hotkeys such as the framestep or play keys. The fix: Ignore IO.WantCaptureKeyboard when the game is paused. ImGui can't meaningfully capture input anyway when the game is paused, so this shouldn't cause any problems elsewhere. Once async presentation is implemented we'll want to revert this change, both because it'll become unnecessary and because ImGui will be able to do stuff while paused and so suppressing emulation hotkeys will actually be useful.
2024-11-15GDBStub: Signal Breakpoint Changes To Hostmitaclaw
2024-10-23Host: Rename `JitCacheInvalidation`mitaclaw
There are two hard problems in computer science...
2024-10-19DolphinQt: JIT Widget Refreshmitaclaw
Fulfilling a certain six-year-old todo.
2024-06-26FrameAdvance: Fix continuous frame advancing while the debug UI is open. ↵TryTwo
Blocks signals from being spammed to update the UI.
2024-05-31TAS Input: Enable hotkeys and controller input when Input has focusDentomologist
Enable emulator hotkeys and controller input (when that option is enabled) when a TAS Input window has focus, as if it was the render window instead. This allows TASers to use frame advance and the like without having to switch the focused window or disabling Hotkeys Require Window Focus which also picks up keypresses while other apps are active. Cursor updates are disabled when the TAS Input window has focus, as otherwise the Wii IR widget (and anything else controlled by the mouse) becomes unusable. The cursor continues to work normally when the render window has focus.
2024-04-08Core::GetState: Avoid Global System Accessormitaclaw
2024-03-31Merge pull request #12645 from mitaclaw/ppc-symbols-signalAdmiral H. Curtiss
DolphinQt: A Ubiquitous Signal For When Symbols Change
2024-03-28DolphinQt: A Ubiquitous Signal For When Symbols Changemitaclaw
There were three distinct mechanisms for signaling symbol changes in DolphinQt: `Host::NotifyMapLoaded`, `MenuBar::NotifySymbolsUpdated`, and `CodeViewWidget::SymbolsChanged`. The behavior of these signals has been consolidated into the new `Host::PPCSymbolsUpdated` signal, which can be emitted from anywhere in DolphinQt to properly update symbols everywhere in DolphinQt.
2024-03-23Core: Remove RunAsCPUThreadmitaclaw
It's a fine function, but CPUThreadGuard is more vogue. Also, its potential for being confused with RunOnCPUThread will not be missed.
2023-12-18VideoCommon/Fifo: Pass system instance through FifoManager constructorLioncache
Given how many member functions make use of the system instance, it's likely just better to pass the system instance in on construction. Makes the interface a little less noisy to use.
2023-12-14DolphinQt/Host: Convert inclusion of Fifo.cpp to Fifo.hLioncash
Quite a bizarre include. Also resolves an indirect include (lol), since this TU was including the system header that way.
2023-12-11DolphinQT/Host: Remove unused TLS variable tls_is_host_threadLioncash
This is never accessed or read from.
2023-06-02Core: Assert that only the Host thread may call PauseAndLock().Admiral H. Curtiss
2023-01-31Split AbstractGfx out of RendererScott Mansell
Almost all the virtual functions in Renderer are part of dolphin's "graphics api abstraction layer", which has slowly formed over the last decade or two. Most of the work was done previously with the introduction of the various "AbstractX" classes, associated with texture cache cleanups and implementation of newer graphics APIs (Direct3D 12, Vulkan, Metal). We are simply taking the last step and yeeting these functions out of Renderer. This "AbstractGfx" class is now completely agnostic of any details from the flipper/hollywood GPU we are emulating, though somewhat specialized. (Will not build, this commit only contains changes outside VideoBackends)
2023-01-31Move Presenting, Dumping and ImGui out of RendererScott Mansell
2022-12-10VideoCommon/Fifo: Pass Core::System to methods.Admiral H. Curtiss
2022-12-10VideoCommon/Fifo: Refactor to class, move to Core::System.Admiral H. Curtiss
2022-08-06Add Discord presence ioctlv to /dev/dolphinInvoxiPlayGames
2022-01-13DolphinQt: Improve the earlier panic alert deadlock fixJosJuice
If the purpose of calling SetFullscreen using RunAsCPUThread is to make sure that the GPU thread is paused, the fix in ef77872 is faulty when dual core is used and a panic alert comes from the CPU thread. This change re-adds synchronization for that case.
2022-01-13DolphinQt: Fix the panic alert deadlock, GPU thread editionJosJuice
The fix in ef77872 worked for panic alerts from the CPU thread, but there were still problems with panic alerts from the GPU thread in dual core mode. This change attempts to fix those.
2021-07-13Qt: Implement GBA host and widgetBonta
2021-07-13Core: Add GBA host interfaceBonta
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
2021-06-07Qt: fix input focus checks being wrongFiloppi
When rendering to main and going full screen, we aren't using the main window handle as the code assumed, but the other, detached, render widget.
2021-06-07Qt: Fix IOWindow keeping a shared ptr to devices even after them being ↵Filoppi
removed by the ControllerInterface this prevented some devices from being recreated correctly, as they were exclusive (e.g. DInput Joysticks) This is achieved by calling Settings::ReleaseDevices(), which releases all the UI devices shared ptrs. If we are the host (Qt) thread, DevicesChanged() is now called in line, to avoid devices being hanged onto by the UI. For this, I had to add a method to check whether we are the Host Thread to Qt. Avoid calling ControllerInterface::RefreshDevices() from the CPU thread if the emulation is running and we manually refresh devices from Qt, as that is not necessary anymore. Refactored the way IOWindow lists devices to make it clearer and hold onto disconnected devices. There were so many issues with the previous code: -Devices changes would not be reflected until the window was re-opened -If there was no default device, it would fail to select the device at index 0 -It could have crashed if we had 0 devices -The default device was not highlighted as such
2021-05-27Implement Cursor Locking and new input focus checks for itFiloppi
2021-03-27Set console's default language/country/region based on computer settingsJosJuice
2021-03-03DolphinQt: Removed unused this capture in lambdaDentomologist
The Host constructor sets a callback on a lambda that in turn calls Host_UpdateDisasmDialog. Since that function is not a member function capturing this is unnecessary. Fixes -Wunused-lambda-capture warning on freebsd-x64.
2020-04-27Merge pull request #8745 from AdmiralCurtiss/savestate-load-callback-qtLéo Lam
Qt/Debugger: Refresh on savestate load.
2020-04-15Qt/Debugger: Refresh windows on savestate load.Admiral H. Curtiss
2020-04-03Remove unused function Host_UpdateProgressDialogJosJuice
2020-04-03DolphinQt: Run tasks that use progress dialogs on separate threadsJosJuice
2019-11-06InputCommon: Make the "input gate" not racey.Jordan Woyak
2019-05-24Update Discord rich presence when the title changesDavid Korth
This allows us to update the rich presence description if a channel is launched from the Wii Menu. It also handles other PPC title launches, e.g. Smash Bros. Masterpieces. Host.h: Added Host_TitleChanged(). DolphinNoGUI/MainNoGUI.cpp: Implemented Host_TitleChanged(). DolphinQt/Host.cpp: Implemented Host_TitleChanged(). Android/jni/MainAndroid.cpp: Stubbed Host_TitleChanged(). DSPTool/StubHost.cpp: Stubbed Host_TitleChanged(). UnitTests/StubHost.cpp: Stubbed Host_TitleChanged().
2019-03-30Config: Move the 'Display' settings from ConfigManager to the layered config ↵iwubcode
system
2019-03-23Add imgui-based Netplay Chatspycrab
2019-03-21Core/Host: Allow frontends to block inputsspycrab
2018-10-29Host: Also call ControllerInterface::ChangeWindow when window changesStenzek
This should prevent us from trying to poll against destroyed native windows.
2018-10-29Host: Don't call ChangeSurface when handle hasn't changedStenzek
This was causing a deadlock when switching to fullscreen in render-to-main-window mode.
2018-10-20Renderer: Pull dimensions from GLInterface/SwapchainStenzek
2018-10-20Drop Host_GetRenderSurface and pass display to backendStenzek