diff --git a/src/core/libraries/np_trophy/trophy_ui.h b/src/core/libraries/np_trophy/trophy_ui.h index d730aca57..060d80dec 100644 --- a/src/core/libraries/np_trophy/trophy_ui.h +++ b/src/core/libraries/np_trophy/trophy_ui.h @@ -31,10 +31,6 @@ public: void Finish(); void Draw() override; - - bool ShouldGrabGamepad() override { - return false; - } }; }; // namespace Libraries::NpTrophy \ No newline at end of file diff --git a/src/core/libraries/system/msgdialog.cpp b/src/core/libraries/system/msgdialog.cpp index 94c122d9b..7d924e4ad 100644 --- a/src/core/libraries/system/msgdialog.cpp +++ b/src/core/libraries/system/msgdialog.cpp @@ -39,11 +39,6 @@ Error PS4_SYSV_ABI sceMsgDialogGetResult(DialogResult* result) { if (result == nullptr) { return Error::ARG_NULL; } - for (const auto v : result->reserved) { - if (v != 0) { - return Error::PARAM_INVALID; - } - } *result = g_result; return Error::OK; } diff --git a/src/core/libraries/system/msgdialog_ui.cpp b/src/core/libraries/system/msgdialog_ui.cpp index eb0ee9098..faeadadc6 100644 --- a/src/core/libraries/system/msgdialog_ui.cpp +++ b/src/core/libraries/system/msgdialog_ui.cpp @@ -266,11 +266,13 @@ void MsgDialogUi::Draw() { CentralizeWindow(); SetNextWindowSize(window_size); - SetNextWindowFocus(); SetNextWindowCollapsed(false); + if (first_render || !io.NavActive) { + SetNextWindowFocus(); + } KeepNavHighlight(); - // Hack to allow every dialog to have a unique window - if (Begin("Message Dialog##MessageDialog", nullptr, ImGuiWindowFlags_NoSavedSettings)) { + if (Begin("Message Dialog##MessageDialog", nullptr, + ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings)) { switch (state->GetMode()) { case MsgDialogMode::USER_MSG: DrawUser(); diff --git a/src/core/libraries/system/msgdialog_ui.h b/src/core/libraries/system/msgdialog_ui.h index f67424869..dfb7515f8 100644 --- a/src/core/libraries/system/msgdialog_ui.h +++ b/src/core/libraries/system/msgdialog_ui.h @@ -174,10 +174,6 @@ public: void SetProgressBarValue(u32 value, bool increment); void Draw() override; - - bool ShouldGrabGamepad() override { - return true; - } }; // Utility function to show a message dialog diff --git a/src/imgui/imgui_layer.h b/src/imgui/imgui_layer.h index a2ec7fd24..a6c7e2a4a 100644 --- a/src/imgui/imgui_layer.h +++ b/src/imgui/imgui_layer.h @@ -12,10 +12,6 @@ public: static void RemoveLayer(Layer* layer); virtual void Draw() = 0; - - virtual bool ShouldGrabGamepad() { - return false; - } }; } // namespace ImGui \ No newline at end of file diff --git a/src/imgui/layer/video_info.cpp b/src/imgui/layer/video_info.cpp index 2a60926fa..bf30f8701 100644 --- a/src/imgui/layer/video_info.cpp +++ b/src/imgui/layer/video_info.cpp @@ -10,7 +10,7 @@ void ImGui::Layers::VideoInfo::Draw() { m_show = IsKeyPressed(ImGuiKey_F10, false) ^ m_show; if (m_show) { - if (Begin("Video Info")) { + if (Begin("Video Info", 0, ImGuiWindowFlags_NoNav)) { Text("Frame time: %.3f ms (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); } End(); diff --git a/src/imgui/renderer/imgui_core.cpp b/src/imgui/renderer/imgui_core.cpp index 3cbd5faa0..d52536f68 100644 --- a/src/imgui/renderer/imgui_core.cpp +++ b/src/imgui/renderer/imgui_core.cpp @@ -9,6 +9,7 @@ #include "imgui_core.h" #include "imgui_impl_sdl3.h" #include "imgui_impl_vulkan.h" +#include "imgui_internal.h" #include "sdl_window.h" #include "texture_manager.h" #include "video_core/renderer_vulkan/renderer_vulkan.h" @@ -97,24 +98,19 @@ void Shutdown(const vk::Device& device) { bool ProcessEvent(SDL_Event* event) { Sdl::ProcessEvent(event); switch (event->type) { + // Don't block release/up events case SDL_EVENT_MOUSE_MOTION: case SDL_EVENT_MOUSE_WHEEL: case SDL_EVENT_MOUSE_BUTTON_DOWN: - case SDL_EVENT_MOUSE_BUTTON_UP: return GetIO().WantCaptureMouse; case SDL_EVENT_TEXT_INPUT: case SDL_EVENT_KEY_DOWN: - case SDL_EVENT_KEY_UP: return GetIO().WantCaptureKeyboard; case SDL_EVENT_GAMEPAD_BUTTON_DOWN: - case SDL_EVENT_GAMEPAD_BUTTON_UP: case SDL_EVENT_GAMEPAD_AXIS_MOTION: - case SDL_EVENT_GAMEPAD_ADDED: - case SDL_EVENT_GAMEPAD_REMOVED: case SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN: - case SDL_EVENT_GAMEPAD_TOUCHPAD_UP: case SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION: - return (GetIO().BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; + return GetIO().NavActive; default: return false; } @@ -138,17 +134,8 @@ void NewFrame() { Sdl::NewFrame(); ImGui::NewFrame(); - bool capture_gamepad = false; for (auto* layer : layers) { layer->Draw(); - if (layer->ShouldGrabGamepad()) { - capture_gamepad = true; - } - } - if (capture_gamepad) { - GetIO().BackendFlags |= ImGuiBackendFlags_HasGamepad; - } else { - GetIO().BackendFlags &= ~ImGuiBackendFlags_HasGamepad; } }