diff --git a/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp b/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp index f44bc6753..da60272e6 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp +++ b/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp @@ -1,15 +1,5 @@ // Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. -#include - -#include "Engine/Engine/Time.h" -#include "Engine/Graphics/RenderTask.h" -#include "Engine/Platform/Base/DragDropHelper.h" -#include "Engine/Platform/Unix/UnixFile.h" - -#include "wayland/xdg-toplevel-drag-v1.h" -#include -#include #if PLATFORM_SDL && PLATFORM_LINUX #include "Engine/Platform/Platform.h" @@ -26,12 +16,18 @@ #include "Engine/Platform/Linux/IncludeX11.h" #include "Engine/Input/Input.h" #include "Engine/Input/Mouse.h" +#include "Engine/Engine/Time.h" +#include "Engine/Graphics/RenderTask.h" +#include "Engine/Platform/Base/DragDropHelper.h" +#include "Engine/Platform/Unix/UnixFile.h" #include #include #include +#include #include +#include // Wayland void WaylandRegistryGlobal(void* data, wl_registry *registry, uint32 id, const char* interface, uint32 version); @@ -1589,10 +1585,6 @@ bool SDLPlatform::InitPlatformX11(void* display) return false; } -void SDLPlatform::Exit() -{ -} - void* SDLPlatform::GetXDisplay() { return xDisplay; diff --git a/Source/Engine/Platform/SDL/SDLPlatform.h b/Source/Engine/Platform/SDL/SDLPlatform.h index 5467e8f82..d67495688 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.h +++ b/Source/Engine/Platform/SDL/SDLPlatform.h @@ -65,7 +65,6 @@ public: // [PlatformBase] static bool Init(); - static void Exit(); static void LogInfo(); static void Tick(); static void SetHighDpiAwarenessEnabled(bool enable); diff --git a/Source/Engine/Platform/SDL/SDLWindow.cpp b/Source/Engine/Platform/SDL/SDLWindow.cpp index 52439450e..bd8009456 100644 --- a/Source/Engine/Platform/SDL/SDLWindow.cpp +++ b/Source/Engine/Platform/SDL/SDLWindow.cpp @@ -308,7 +308,9 @@ SDLWindow::~SDLWindow() if (_window == nullptr) return; +#if PLATFORM_LINUX SurfaceToWindowMap.RemoveValue(this); +#endif SDL_StopTextInput(_window); SDL_DestroyWindow(_window); @@ -824,8 +826,10 @@ void SDLWindow::Hide() SDL_HideWindow(_window); +#if PLATFORM_LINUX if (SDLPlatform::UsesWayland() && _dragOver) StopDragging(); +#endif WindowBase::Hide(); } @@ -1321,8 +1325,11 @@ void SDLWindow::StartDragging(const Float2& offset, Window* dragSourceWindow) #endif } +#if PLATFORM_LINUX SetOpacity(0.1f); - DoDragDropWayland(String("notawindow"), dragSourceWindow, dragOffset); + if (SDLPlatform::UsesWayland() + DoDragDropWayland(String("notawindow"), dragSourceWindow, dragOffset); +#endif /* _dragOver = true;