diff --git a/dev/src/host_lin_wayland.cpp b/dev/src/host_lin_wayland.cpp index 84300f0..74de900 100644 --- a/dev/src/host_lin_wayland.cpp +++ b/dev/src/host_lin_wayland.cpp @@ -226,6 +226,7 @@ namespace olc::host if (!this->OnSystemThreadStart()) { // PGE->OnContextStart() failed, or user aborted OnUserCreate() + systemActive = false; return; } @@ -252,7 +253,7 @@ namespace olc::host bool keep_running = true; while(systemActive && keep_running) { if(decor_context) { - poll(&decor_wl_fd, 1, -1); + poll(&decor_wl_fd, 1, 10); { std::lock_guard l{decor_mutex}; keep_running = libdecor_dispatch(decor_context, 0) >= 0; diff --git a/dev/src/host_lin_x11.cpp b/dev/src/host_lin_x11.cpp index 750f669..867896e 100644 --- a/dev/src/host_lin_x11.cpp +++ b/dev/src/host_lin_x11.cpp @@ -101,6 +101,7 @@ namespace olc::host // Notify start of system thread if (!this->OnSystemThreadStart()) { + systemActive = false; // PGE->OnContextStart() failed, or user aborted OnUserCreate() return; } @@ -303,7 +304,7 @@ namespace olc::host } // Wait until an event appears on the x11 event queue file descriptor - poll(&x11_connection_fd, 1, -1); + poll(&x11_connection_fd, 1, 10); } systemActive = false; diff --git a/olcPixelGameEngine3.h b/olcPixelGameEngine3.h index 3725ed0..3617b27 100644 --- a/olcPixelGameEngine3.h +++ b/olcPixelGameEngine3.h @@ -12427,6 +12427,7 @@ namespace olc::host // Notify start of system thread if (!this->OnSystemThreadStart()) { + systemActive = false; // PGE->OnContextStart() failed, or user aborted OnUserCreate() return; } @@ -12629,7 +12630,7 @@ namespace olc::host } // Wait until an event appears on the x11 event queue file descriptor - poll(&x11_connection_fd, 1, -1); + poll(&x11_connection_fd, 1, 10); } systemActive = false; @@ -13201,6 +13202,7 @@ namespace olc::host if (!this->OnSystemThreadStart()) { // PGE->OnContextStart() failed, or user aborted OnUserCreate() + systemActive = false; return; } @@ -13227,7 +13229,7 @@ namespace olc::host bool keep_running = true; while(systemActive && keep_running) { if(decor_context) { - poll(&decor_wl_fd, 1, -1); + poll(&decor_wl_fd, 1, 10); { std::lock_guard l{decor_mutex}; keep_running = libdecor_dispatch(decor_context, 0) >= 0;