diff --git a/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp b/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp index e272aafc2..a0763d1c3 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp +++ b/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp @@ -551,37 +551,7 @@ DragDropEffect Window::DoDragDropWayland(const StringView& data, Window* dragSou // For drag-and-drop, we need to run another event queue in a separate thread to avoid racing issues // while SDL is dispatching the main Wayland event queue when receiving the data offer from us. - // Show the window without changing the focus - //Show(); - - if (!_visible) - { - if (_showAfterFirstPaint) - { - if (RenderTask) - RenderTask->Enabled = true; - } - else - SDL_ShowWindow(_window); - } - WindowBase::Show(); - - /*{ - const double time = Platform::GetTimeSeconds(); - - // Update game logic - if (Time::OnBeginUpdate(time)) - { - Engine::OnUpdate(); - Engine::OnLateUpdate(); - Time::OnEndUpdate(); - } - - SDLPlatform::Tick(); - Engine::OnDraw(); - - Platform::Sleep(1); - }*/ + Engine::OnDraw(); WaylandImpl::DraggingActive = true; WaylandImpl::DraggingData = StringView(data.Get(), data.Length()); @@ -602,14 +572,11 @@ DragDropEffect Window::DoDragDropWayland(const StringView& data, Window* dragSou { SDLPlatform::Tick(); Engine::OnUpdate();//Scripting::Update(); // For docking updates - //if (Platform::AtomicRead(&task->WaitFlag) == 1) - Engine::OnDraw(); + Engine::OnDraw(); // The window needs to be finished showing up before we can start dragging it if (IsVisible() && Platform::AtomicRead(&task->WaitFlag) == 0) - { Platform::AtomicStore(&task->WaitFlag, 1); - } Platform::Sleep(1); } @@ -1472,11 +1439,23 @@ DragDropEffect SDLWindow::DoDragDrop(const StringView& data, const Float2& offse float topOffset = 25.0f; dragOffset += Float2(0.0f, topOffset); } + + // Show the window without changing focus + if (!_visible) + { + if (_showAfterFirstPaint) + { + if (RenderTask) + RenderTask->Enabled = true; + } + else + SDL_ShowWindow(_window); + } + WindowBase::Show(); WaylandImpl::DraggingWindow = true; DoDragDropWayland(String(""), dragSourceWindow, dragOffset); WaylandImpl::DraggingWindow = false; - //Show(); } else Show();