summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Main.cpp
AgeCommit message (Collapse)Author
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: Remove IsHostThreadJosJuice
The core no longer cares which thread is the host thread. Cleaning up Android's HostThreadLock is left for another PR, in part because the HostThreadLock in NativeConfig.cpp still serves a purpose, and in part to make any issues easier to bisect.
2025-10-27AdvancedPane: Add a button to restore default settingsJoshua Vandaële
2025-09-07DolphinQt: Center dialogs on top-level parent window.cristian64
The `QtUtils::AdjustSizeWithinScreen()` function now centers the widget on their parent window after the widget's size is adjusted. This is required in some desktop environments (generally on Linux systems) to ensure that the just-resized widget remains aligned with its parent window. The creation of the **Cheats Manager** dialog is now deferred to first show, as creating it within the main window's constructor prevents the dialog from knowing the real position of its parent window, which is only properly calculated on first show. For the same reasons, the analytics prompt is now shown only when the application is ready (i.e. when the main window has been shown). | Before | After | | ------ | ----- | | <img width="1920" height="1080" alt="[Dolphin Emulator] Misplaced analytics prompt" title="[Dolphin Emulator] Misplaced analytics prompt" src="https://github.com/user-attachments/assets/c3e43b3b-cf79-4398-b531-7de6068c583e" /> | <img width="1920" height="1080" alt="[Dolphin Emulator] Centered analytics prompt" title="[Dolphin Emulator] Centered analytics prompt" src="https://github.com/user-attachments/assets/a10d06d9-7438-4032-b96c-dfcb48826349" /> | | <img width="1920" height="1080" alt="[Dolphin Emulator] Misplaced Settings dialog" title="[Dolphin Emulator] Misplaced Settings dialog" src="https://github.com/user-attachments/assets/f35b10ee-4f07-48d4-86f9-2537ad5ca7ca" /> | <img width="1920" height="1080" alt="[Dolphin Emulator] Centered Settings dialog" title="[Dolphin Emulator] Centered Settings dialog" src="https://github.com/user-attachments/assets/33e37237-77a4-44f6-a0e2-b709f65b672b" /> | | <img width="1920" height="1080" alt="[Dolphin Emulator] Misplaced Cheats Manager dialog" title="[Dolphin Emulator] Misplaced Cheats Manager dialog" src="https://github.com/user-attachments/assets/1fbd3836-5639-4d5a-b57e-e2e21f21c9db" /> | <img width="1920" height="1080" alt="[Dolphin Emulator] Centered Cheats Manager dialog" title="[Dolphin Emulator] Centered Cheats Manager dialog" src="https://github.com/user-attachments/assets/3f2b1b50-de16-49b7-bac4-c444c6cab0bc" /> |
2025-08-04Qt: Better wayland detection to enforce xcbJoshua Vandaële
In certain cases, the platform can be "wayland-egl", "wayland-xcomposite", and other values for which I haven't found a full list yet. Instead of matching only "wayland", we now look for "wayland" anywhere in the `QT_QPA_PLATFORM` string in a case-insensitive manner. Acknowledgements: `CaseInsensitiveContains`' implementation was heavily inspired by GNU's non-standard glibc `strcasestr` function, which can be found here licensed under GPLv2 or later: https://ftp.gnu.org/gnu/libc/
2025-06-07DolphinQt: Replace widespread SetQWidgetWindowDecorations calls with an ↵Jordan Woyak
event filter.
2025-01-20Enforce XCB within codeJoshua Vandaële
2024-10-24MainWindow: Avoid Global System Accessormitaclaw
2024-09-27DolphinQt: Remove unneeded Win32 coderobxnano
Dolphin already uses QStyleHints::colorScheme to detect dark mode, so this code is now redundant.
2024-06-23MainWindow: Remove Show() and redistribute its logic to other places.TryTwo
bugfix: SetQWidgetWindowDecorations(this); not called before show() for Windows darkmode titlebars. The actual call to (QWidget) show() needed to come sooner. Show() was originally left alone, but with other checks needing to move with (QWidget) show(), this function became less useful. Show() was originally created to fix the render widget appearing behind the main window, but that appears to work fine in this iteration.
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.
2024-03-18Core: Avoid (Some) Global System Accessormitaclaw
2023-11-05DolphinQt/Settings: Split setting of the user style into two functions.Admiral H. Curtiss
This makes it so that if you just want to reload the current style (eg. on program start, or in response to a system event), you don't need to know the name of the currently selected user style. It's also more consistent with the way the 'userstyle/enabled' flag works.
2023-08-12DolphinQt: Set the theme before constructing the MainWindow, some panels ↵Admiral H. Curtiss
that explicitly request palette colors get the wrong colors otherwise.
2023-08-12DolphinQt: Set the application palette to a matching one when the Windows ↵Admiral H. Curtiss
dark theme is in use.
2023-08-12DolphinQt: Switch dark/light theme when Windows theme changes.Admiral H. Curtiss
2023-08-12DolphinQt: Set window decorations for all top-level QWidgets.Admiral H. Curtiss
2023-08-12DolphinQt: On Windows, detect whether the system is using a dark theme.Admiral H. Curtiss
Co-authored-by: FearlessTobi <thm.frey@gmail.com>
2023-06-02Core: Assert that only the Host thread may call PauseAndLock().Admiral H. Curtiss
2023-05-29Revert "Revert "DolphinQt: use default dpi rounding mode (passthrough)""Shawn Hoffman
This reverts commit 20e14aab06b127870f8ca5bd170fda4c560bef82.
2023-05-16StringUtil: Move CommandLineToUtf8Argv() into Common namespaceLioncash
2023-05-02Revert "DolphinQt: use default dpi rounding mode (passthrough)"JosJuice
This reverts commit cfe36836688ae21ae32383958504fbc5f6c21660. On Windows systems with 125% DPI scaling, this was causing both icons and the OSD to be upscaled by 25% using nearest neighbor scaling, which looks really bad. shuffle2 has said that this will be improved later, but we should revert it for now for the sake of the upcoming beta build.
2023-04-25DolphinQt: fix handling of Qt-specific cmdline argsShawn Hoffman
QApplication should parse and remove and args it recognizes before dolphin starts inspecting the args. This allows using e.g. -style <style> on the commandline.
2023-04-23DolphinQt: use default dpi rounding mode (passthrough)Shawn Hoffman
2023-04-17Treat --debugger command line as a temporary settingPokechu22
Before, Settings::SetDebugModeEnabled was used; this calls SetBaseOrCurrent() which will usually permanently change the base configuration setting for the debugger to true. Thus, the debugger would remain active even if the --debugger command line option was removed. Now, it remains active only for the current run, like other command-line options. Note that SetBaseOrCurrent is also used by the "Show Debugging UI" option under Options -> Interface; this means that if the debugger is turned off (or off and then back on) by the user while --debugger is specified, this will be reset to whatever the base configuration had when Dolphin is closed and reopened. This behavior is consistent with the rest of the UI. To my understanding, the --debugger option is something from 5.0 stable/DolphinWx where there was no way to toggle the debug UI in the settings (and the command-line option was the only way of enabling it). It's less useful nowadays.
2023-04-10Resolve [-Wwrite-strings]Minty-Meeo
2023-01-20DolphinQt: Add workaround for Qt 6.3+ bug on LinuxOatmealDome
See https://bugs.dolphin-emu.org/issues/12913 for more information.
2022-09-24Integrate "Ignore for this session" better with config systemJosJuice
Because of the previous commit, this is needed to stop DolphinQt from forgetting that the user pressed ignore whenever any part of the config is changed. This commit also changes the behavior a bit on DolphinQt: "Ignore for this session" now applies to the current emulation session instead of the current Dolphin launch. This matches how it already worked on Android, and is in my opinion better because it means the user won't lose out on important panic alerts in a game becase they played another game first that had repeated panic alerts that they wanted to ignore. For Android, this commit isn't necessary, but it makes the code cleaner.
2022-05-25Windows: Remove unused Qt 5 code and referencesDentomologist
2022-05-16Merge pull request #8763 from JosJuice/panic-alert-deadlock-gpuAdmiral H. Curtiss
DolphinQt: Fix the panic alert deadlock, dual core edition
2022-05-02Add support for building against Qt 6spycrab
2022-03-07windows: wrap all main funcs with utf8 conversionsShawn Hoffman
fixes 12858
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-12-27Config: Port AutoUpdate settings to new config system.Admiral H. Curtiss
2021-11-22Core/Boot: Refactor storage of boot-to-savestate data into a separate class.Admiral H. Curtiss
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 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-04-28Qt: make all tooltips look similar to balloon tips (and share parts of their ↵Filoppi
code)
2021-01-27rename Core/Analytics to Core/DolphinAnalyticsShawn Hoffman
2020-09-21DolphinQt: Stop using qtmainJosJuice
2020-09-21DolphinQt: Handle non-ASCII characters in Windows cmd argumentsJosJuice
CommandLineParse expects UTF-8 strings. (QApplication, on the other hand, seems to be designed so that you can pass in the char** argv untouched on Windows and get proper Unicode handling.)
2020-09-07Merge pull request #8976 from JosJuice/port-some-settingsLC
Port some settings to the new config system
2020-08-04DolphinQt: Ignore "-psn" command line option on macOSOatmealDome
2020-08-03Port some settings to the new config systemJosJuice
Other than the controller settings and JIT debug settings, these are the only settings which were defined in Java code but not defined in the new config system in C++. (There are still a lot of settings that are defined in the new config system but not yet saveable in the new config system, though.)
2020-05-06Core: Add support for specifying a command line option to boot the game into ↵iwubcode
a save-state
2020-03-31DolphinQt: Fix the panic alert deadlock (a.k.a. "Question" issue)JosJuice
2020-03-22Parse arguments before QtAlexApps99
2020-02-17Windows GUI: Use QMenu font (Segoe UI) for entire applicationnyanpasu64
On Windows, Qt's default system font (MS Shell Dlg 2) is outdated. Dolphin previously used over 15 lines of code to compute a font closer to the proper font, but with an approximately correct font size. Using the QMenu font directly is both more concise and more elegant (in my opinion).
2019-11-23Simplify wstring to QString conversiontinyredpanda