commit c4be63627713c10b13ca43d8e4d118f9c5e9414c
parent afbac6a2829b01b0d55d41ee9678d1eb79393411
Author: falkTX <falktx@falktx.com>
Date: Sat, 22 May 2021 13:26:38 +0100
Ignore focus-out events on closed windows
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/dgl/src/WindowPrivateData.cpp b/dgl/src/WindowPrivateData.cpp
@@ -303,6 +303,7 @@ void Window::PrivateData::hide()
void Window::PrivateData::close()
{
DGL_DBG("Window close\n");
+ // DGL_DBGp("Window close DBG %i %i %p\n", isEmbed, isClosed, appData);
if (isEmbed || isClosed)
return;
@@ -531,6 +532,9 @@ void Window::PrivateData::onPuglFocus(const bool focus, const CrossingMode mode)
{
DGL_DBGp("onPuglFocus : %i %i\n", focus, mode);
+ if (isClosed)
+ return;
+
if (modal.child != nullptr)
return modal.child->focus();
diff --git a/tests/Makefile b/tests/Makefile
@@ -33,7 +33,7 @@ ifeq ($(HAVE_STUB),true)
UNIT_TESTS += Window.stub
endif
ifeq ($(HAVE_VULKAN),true)
-UNIT_TESTS += Window.vulkan
+UNIT_TESTS += Window.vulkan
endif
MANUAL_TARGETS = $(MANUAL_TESTS:%=../build/tests/%$(APP_EXT))
@@ -144,5 +144,9 @@ clean:
-include ../build/tests/Demo.cpp.cairo.d
-include ../build/tests/Demo.cpp.opengl.d
-include ../build/tests/Demo.cpp.vulkan.d
+-include ../build/tests/Window.cpp.cairo.d
+-include ../build/tests/Window.cpp.opengl.d
+-include ../build/tests/Window.cpp.stub.d
+-include ../build/tests/Window.cpp.vulkan.d
# ---------------------------------------------------------------------------------------------------------------------
diff --git a/tests/tests.hpp b/tests/tests.hpp
@@ -49,6 +49,7 @@ private:
void run() override
{
d_sleep(numSecondsToWait);
+ d_stdout("About to quit now...");
app.quit();
}
};