Browse Source

Ignore focus-out events on closed windows

Signed-off-by: falkTX <falktx@falktx.com>
pull/272/head
falkTX 4 years ago
parent
commit
c4be636277
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 10 additions and 1 deletions
  1. +4
    -0
      dgl/src/WindowPrivateData.cpp
  2. +5
    -1
      tests/Makefile
  3. +1
    -0
      tests/tests.hpp

+ 4
- 0
dgl/src/WindowPrivateData.cpp View File

@@ -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();



+ 5
- 1
tests/Makefile View File

@@ -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

# ---------------------------------------------------------------------------------------------------------------------

+ 1
- 0
tests/tests.hpp View File

@@ -49,6 +49,7 @@ private:
void run() override
{
d_sleep(numSecondsToWait);
d_stdout("About to quit now...");
app.quit();
}
};


Loading…
Cancel
Save