Merge DoDragDropJob to hsare the same code for Mac and Windows

#1723
This commit is contained in:
Wojtek Figat
2023-11-06 17:03:03 +01:00
parent b47420f232
commit e7b1fce3eb
3 changed files with 34 additions and 48 deletions

View File

@@ -8,9 +8,7 @@
#include "Engine/Platform/IGuiData.h"
#if USE_EDITOR
#include "Engine/Platform/CriticalSection.h"
#include "Engine/Threading/ThreadPoolTask.h"
#include "Engine/Threading/ThreadPool.h"
#include "Engine/Engine/Engine.h"
#include "Engine/Platform/Base/DragDropHelper.h"
#endif
#include "Engine/Core/Log.h"
#include "Engine/Input/Input.h"
@@ -25,23 +23,7 @@
// Data for drawing window while doing drag&drop on Mac (engine is paused during platform tick)
CriticalSection MacDragLocker;
NSDraggingSession* MacDragSession = nullptr;
class DoDragDropJob* MacDragJob = nullptr;
class DoDragDropJob : public ThreadPoolTask
{
public:
int64 ExitFlag = 0;
bool Run() override
{
while (Platform::AtomicRead(&ExitFlag) == 0)
{
Engine::OnDraw();
Platform::Sleep(20);
}
return false;
}
};
DoDragDropJob* MacDragJob = nullptr;
#endif
inline bool IsWindowInvalid(Window* win)