Compare commits

...

5 Commits

Author SHA1 Message Date
dreamsyntax
d655ece209
Merge 3ec5454b10 into 2c92e5b5b3 2024-11-12 11:14:12 +01:00
OatmealDome
2c92e5b5b3
Merge pull request #13160 from cpba/flatpak-6.8-runtime
Flatpak: Upgrade kde runtime to 6.8
2024-11-12 00:30:46 -05:00
Carles Pastor
fe96bf4108 Flatpak: Upgrade kde runtime to 6.8
this version bundles SDL2-2.30.6, the temporary measure of building the
vendored version from exports is no longer necessary.
2024-11-10 12:06:06 +01:00
dreamsyntax
3ec5454b10 address comment (move callback deregister to quit guard) 2024-11-04 00:32:50 -07:00
dreamsyntax
7b2b6d7a32 DolphinQt: DualSense Player LED toggle 2024-11-03 23:55:46 -07:00
7 changed files with 26 additions and 30 deletions

View File

@ -1,22 +0,0 @@
{
"name": "SDL2",
"buildsystem": "autotools",
"config-opts": ["--disable-static"],
"sources": [
{
"type": "dir",
"path": "../../Externals/SDL/SDL"
}
],
"cleanup": [ "/bin/sdl2-config",
"/include",
"/lib/libSDL2.la",
"/lib/libSDL2main.a",
"/lib/libSDL2main.la",
"/lib/libSDL2_test.a",
"/lib/libSDL2_test.la",
"/lib/cmake",
"/share/aclocal",
"/lib/pkgconfig"]
}

View File

@ -1,6 +1,6 @@
app-id: org.DolphinEmu.dolphin-emu
runtime: org.kde.Platform
runtime-version: '6.7'
runtime-version: '6.8'
sdk: org.kde.Sdk
command: dolphin-emu-wrapper
rename-desktop-file: dolphin-emu.desktop
@ -47,9 +47,6 @@ modules:
url: https://github.com/Unrud/xdg-screensaver-shim/archive/0.0.2.tar.gz
sha256: 0ed2a69fe6ee6cbffd2fe16f85116db737f17fb1e79bfb812d893cf15c728399
# build the vendored SDL2 from Externals until the runtime gets 2.30.6
- SDL2/SDL2.json
- name: dolphin-emu
buildsystem: cmake-ninja
config-opts:

View File

@ -487,6 +487,7 @@ const Info<bool> MAIN_MOVIE_SHOW_RERECORD{{System::Main, "Movie", "ShowRerecord"
// Main.Input
const Info<bool> MAIN_INPUT_BACKGROUND_INPUT{{System::Main, "Input", "BackgroundInput"}, false};
const Info<bool> MAIN_INPUT_SDL_PS5_PLAYER_LED{{System::Main, "Input", "SDLPS5PlayerLED"}, false};
// Main.Debug

View File

@ -320,6 +320,7 @@ extern const Info<bool> MAIN_MOVIE_SHOW_RERECORD;
// Main.Input
extern const Info<bool> MAIN_INPUT_BACKGROUND_INPUT;
extern const Info<bool> MAIN_INPUT_SDL_PS5_PLAYER_LED;
// Main.Debug

View File

@ -33,10 +33,12 @@ void CommonControllersWidget::CreateLayout()
m_common_box = new QGroupBox(tr("Common"));
m_common_layout = new QVBoxLayout();
m_common_bg_input = new QCheckBox(tr("Background Input"));
m_common_sdl_ps5_player_led = new QCheckBox(tr("Enable DualSense Player LED"));
m_common_configure_controller_interface =
new NonDefaultQPushButton(tr("Alternate Input Sources"));
m_common_layout->addWidget(m_common_bg_input);
m_common_layout->addWidget(m_common_sdl_ps5_player_led);
m_common_layout->addWidget(m_common_configure_controller_interface);
m_common_box->setLayout(m_common_layout);
@ -51,6 +53,8 @@ void CommonControllersWidget::CreateLayout()
void CommonControllersWidget::ConnectWidgets()
{
connect(m_common_bg_input, &QCheckBox::toggled, this, &CommonControllersWidget::SaveSettings);
connect(m_common_sdl_ps5_player_led, &QCheckBox::toggled, this,
&CommonControllersWidget::SaveSettings);
connect(m_common_configure_controller_interface, &QPushButton::clicked, this,
&CommonControllersWidget::OnControllerInterfaceConfigure);
}
@ -67,10 +71,14 @@ void CommonControllersWidget::OnControllerInterfaceConfigure()
void CommonControllersWidget::LoadSettings()
{
SignalBlocking(m_common_bg_input)->setChecked(Config::Get(Config::MAIN_INPUT_BACKGROUND_INPUT));
SignalBlocking(m_common_sdl_ps5_player_led)
->setChecked(Config::Get(Config::MAIN_INPUT_SDL_PS5_PLAYER_LED));
}
void CommonControllersWidget::SaveSettings()
{
Config::SetBaseOrCurrent(Config::MAIN_INPUT_BACKGROUND_INPUT, m_common_bg_input->isChecked());
Config::SetBaseOrCurrent(Config::MAIN_INPUT_SDL_PS5_PLAYER_LED,
m_common_sdl_ps5_player_led->isChecked());
Config::Save();
}

View File

@ -30,5 +30,6 @@ private:
QGroupBox* m_common_box;
QVBoxLayout* m_common_layout;
QCheckBox* m_common_bg_input;
QCheckBox* m_common_sdl_ps5_player_led;
QPushButton* m_common_configure_controller_interface;
};

View File

@ -14,6 +14,7 @@
#include "Common/Logging/Log.h"
#include "Common/MathUtil.h"
#include "Common/ScopeGuard.h"
#include "Core/Config/MainSettings.h"
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#ifdef _WIN32
@ -287,6 +288,7 @@ public:
private:
void OpenAndAddDevice(int index);
void SetPS5PlayerLED();
bool HandleEventAndContinue(const SDL_Event& e);
@ -435,11 +437,13 @@ InputBackend::InputBackend(ControllerInterface* controller_interface)
// We want buttons to come in as positions, not labels
SDL_SetHint(SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS, "0");
// Disable DualSense Player LEDs; We already colorize the Primary LED
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED, "0");
const Config::ConfigChangedCallbackID config_changed_callback_id =
Config::AddConfigChangedCallback([this] { SetPS5PlayerLED(); });
SetPS5PlayerLED();
m_hotplug_thread = std::thread([this] {
Common::ScopeGuard quit_guard([] {
m_hotplug_thread = std::thread([this, config_changed_callback_id] {
Common::ScopeGuard quit_guard([config_changed_callback_id] {
Config::RemoveConfigChangedCallback(config_changed_callback_id);
// TODO: there seems to be some sort of memory leak with SDL, quit isn't freeing everything up
SDL_Quit();
});
@ -528,6 +532,12 @@ void InputBackend::PopulateDevices()
SDL_PushEvent(&populate_event);
}
void InputBackend::SetPS5PlayerLED()
{
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED,
Config::Get(Config::MAIN_INPUT_SDL_PS5_PLAYER_LED) ? "1" : "0");
}
struct SDLMotionAxis
{
std::string_view name;