Completely run effEditIdle from a timer

Although it hasn't shown up, this will get rid of the possibility of
off-thread effEditIdle calls causing issues. And since we need some way
to run call this function while the event loop is running anyways, doing
it entirely from a timer similar to how hosts on Windows would do it
seems like the best solution.
This commit is contained in:
Robbert van der Helm
2021-01-04 15:50:17 +01:00
parent c554b9b4ab
commit 4ec8b01bcc
7 changed files with 109 additions and 15 deletions
+6 -5
View File
@@ -50,6 +50,8 @@ Win32Thread::~Win32Thread() {
Win32Thread::Win32Thread() : handle(nullptr, nullptr) {}
Win32Timer::Win32Timer() {}
Win32Timer::Win32Timer(HWND window_handle,
size_t timer_id,
unsigned int interval_ms)
@@ -63,13 +65,12 @@ Win32Timer::~Win32Timer() {
}
}
Win32Timer::Win32Timer(Win32Timer&& o) : timer_id(o.timer_id) {
o.timer_id = std::nullopt;
}
Win32Timer::Win32Timer(Win32Timer&& o)
: window_handle(o.window_handle), timer_id(std::move(o.timer_id)) {}
Win32Timer& Win32Timer::operator=(Win32Timer&& o) {
timer_id = o.timer_id;
o.timer_id = std::nullopt;
window_handle = o.window_handle;
timer_id = std::move(o.timer_id);
return *this;
}