GUI: fix non-working mouse events after minimizing

This commit is contained in:
tildearrow 2022-10-23 02:51:38 -05:00
parent 403bc76d18
commit e19538af2e
3 changed files with 19 additions and 2 deletions

View file

@ -378,6 +378,14 @@ void FurnaceGUI::drawDebug() {
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Window Debug")) {
ImGui::Text("Screen: %dx%d+%d+%d",scrW,scrH,scrX,scrY);
ImGui::Text("Screen (Conf): %dx%d+%d+%d",scrConfW,scrConfH,scrConfX,scrConfY);
ImGui::Text("Canvas: %dx%d",canvasW,canvasH);
ImGui::Text("Maximized: %d",scrMax);
ImGui::Text("System Managed Scale: %d",sysManagedScale);
ImGui::TreePop();
}
if (ImGui::TreeNode("Playground")) {
if (pgSys<0 || pgSys>=e->song.systemLen) pgSys=0;
if (ImGui::BeginCombo("Chip",fmt::sprintf("%d. %s",pgSys+1,e->getSystemName(e->song.system[pgSys])).c_str())) {

View file

@ -1,3 +1,4 @@
#include <SDL_error.h>
#define _USE_MATH_DEFINES
// OK, sorry for inserting the define here but I'm so tired of this extension
/**
@ -3074,6 +3075,7 @@ bool FurnaceGUI::loop() {
// update config x/y/w/h values based on scrMax state
if (updateWindow) {
logV("updateWindow is true");
if (!scrMax) {
scrConfX=scrX;
scrConfY=scrY;
@ -3082,7 +3084,11 @@ bool FurnaceGUI::loop() {
}
// update canvas size as well
SDL_GetRendererOutputSize(sdlRend,&canvasW,&canvasH);
if (SDL_GetRendererOutputSize(sdlRend,&canvasW,&canvasH)!=0) {
logW("updateWindow: error while getting output size! %s",SDL_GetError());
} else {
logV("updateWindow: canvas size %dx%d",canvasW,canvasH);
}
}
wantCaptureKeyboard=ImGui::GetIO().WantTextInput;