mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 08:52:36 +00:00
Proper fix for ImGui event passthrough
This commit is contained in:
parent
7e10d78341
commit
3b07c9d418
@ -33,6 +33,7 @@ static std::deque<std::pair<bool, ImGui::Layer*>> change_layers{};
|
|||||||
static std::mutex change_layers_mutex{};
|
static std::mutex change_layers_mutex{};
|
||||||
|
|
||||||
static ImGuiID dock_id;
|
static ImGuiID dock_id;
|
||||||
|
static ImGuiID game_window_id = 1054440878;
|
||||||
|
|
||||||
namespace ImGui {
|
namespace ImGui {
|
||||||
|
|
||||||
@ -141,9 +142,6 @@ void Shutdown(const vk::Device& device) {
|
|||||||
|
|
||||||
bool ProcessEvent(SDL_Event* event) {
|
bool ProcessEvent(SDL_Event* event) {
|
||||||
Sdl::ProcessEvent(event);
|
Sdl::ProcessEvent(event);
|
||||||
if (!DebugState.IsShowingDebugMenuBar()) {
|
|
||||||
return false; // temp workaround, only works if the debug menu is inactive
|
|
||||||
}
|
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
// Don't block release/up events
|
// Don't block release/up events
|
||||||
case SDL_EVENT_MOUSE_MOTION:
|
case SDL_EVENT_MOUSE_MOTION:
|
||||||
@ -151,7 +149,7 @@ bool ProcessEvent(SDL_Event* event) {
|
|||||||
case SDL_EVENT_MOUSE_BUTTON_DOWN: {
|
case SDL_EVENT_MOUSE_BUTTON_DOWN: {
|
||||||
const auto& io = GetIO();
|
const auto& io = GetIO();
|
||||||
return io.WantCaptureMouse && io.Ctx->NavWindow != nullptr &&
|
return io.WantCaptureMouse && io.Ctx->NavWindow != nullptr &&
|
||||||
io.Ctx->NavWindow->ID != dock_id;
|
(io.Ctx->NavWindow->Flags & ImGuiWindowFlags_NoNav) == 0;
|
||||||
}
|
}
|
||||||
case SDL_EVENT_TEXT_INPUT:
|
case SDL_EVENT_TEXT_INPUT:
|
||||||
case SDL_EVENT_KEY_DOWN: {
|
case SDL_EVENT_KEY_DOWN: {
|
||||||
|
Loading…
Reference in New Issue
Block a user