diff --git a/Source/Editor/GUI/Docking/WindowDragHelper.cs b/Source/Editor/GUI/Docking/WindowDragHelper.cs index 9ec30fe6b..12587b061 100644 --- a/Source/Editor/GUI/Docking/WindowDragHelper.cs +++ b/Source/Editor/GUI/Docking/WindowDragHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. using System; using FlaxEngine; diff --git a/Source/Engine/Platform/Base/Enums.h b/Source/Engine/Platform/Base/Enums.h index 69c5a43a1..4a903ad19 100644 --- a/Source/Engine/Platform/Base/Enums.h +++ b/Source/Engine/Platform/Base/Enums.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #pragma once diff --git a/Source/Engine/Platform/Base/ScreenUtilitiesBase.h b/Source/Engine/Platform/Base/ScreenUtilitiesBase.h index 18ac8c61f..b6259c40d 100644 --- a/Source/Engine/Platform/Base/ScreenUtilitiesBase.h +++ b/Source/Engine/Platform/Base/ScreenUtilitiesBase.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #pragma once diff --git a/Source/Engine/Platform/Linux/LinuxScreenUtilities.cpp b/Source/Engine/Platform/Linux/LinuxScreenUtilities.cpp index 0295a82c7..cd75fe8ef 100644 --- a/Source/Engine/Platform/Linux/LinuxScreenUtilities.cpp +++ b/Source/Engine/Platform/Linux/LinuxScreenUtilities.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #if PLATFORM_LINUX @@ -15,11 +15,7 @@ #if PLATFORM_SDL #include #include -#endif -Delegate ScreenUtilitiesBase::PickColorDone; - -#if PLATFORM_SDL namespace PortalImpl { XdpPortal* Portal = nullptr; @@ -30,6 +26,8 @@ namespace PortalImpl } #endif +Delegate ScreenUtilitiesBase::PickColorDone; + Color32 LinuxScreenUtilities::GetColorAt(const Float2& pos) { X11::Display* display = (X11::Display*)Platform::GetXDisplay(); @@ -125,6 +123,7 @@ void LinuxScreenUtilities::PickColor() } #if PLATFORM_SDL + gpointer PortalImpl::GLibMainLoop(gpointer data) { GMainContext* mainContext = g_main_context_get_thread_default(); diff --git a/Source/Engine/Platform/Linux/LinuxScreenUtilities.h b/Source/Engine/Platform/Linux/LinuxScreenUtilities.h index b56520569..27fdb9297 100644 --- a/Source/Engine/Platform/Linux/LinuxScreenUtilities.h +++ b/Source/Engine/Platform/Linux/LinuxScreenUtilities.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #pragma once @@ -7,7 +7,6 @@ #include "Engine/Platform/Base/ScreenUtilitiesBase.h" #include "Engine/Core/Types/BaseTypes.h" #include "Engine/Core/Math/Color32.h" -#include "Engine/Core/Math/Vector2.h" #include "Engine/Core/Delegate.h" /// diff --git a/Source/Engine/Platform/Mac/MacScreenUtilities.cpp b/Source/Engine/Platform/Mac/MacScreenUtilities.cpp index a482362f0..62c405635 100644 --- a/Source/Engine/Platform/Mac/MacScreenUtilities.cpp +++ b/Source/Engine/Platform/Mac/MacScreenUtilities.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #if USE_EDITOR && PLATFORM_MAC diff --git a/Source/Engine/Platform/Mac/MacScreenUtilities.h b/Source/Engine/Platform/Mac/MacScreenUtilities.h index 8a9610d7e..4f7ef0347 100644 --- a/Source/Engine/Platform/Mac/MacScreenUtilities.h +++ b/Source/Engine/Platform/Mac/MacScreenUtilities.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #pragma once diff --git a/Source/Engine/Platform/SDL/SDLClipboard.h b/Source/Engine/Platform/SDL/SDLClipboard.h index 54e9b0c59..f9862b621 100644 --- a/Source/Engine/Platform/SDL/SDLClipboard.h +++ b/Source/Engine/Platform/SDL/SDLClipboard.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #pragma once diff --git a/Source/Engine/Platform/SDL/SDLInput.cpp b/Source/Engine/Platform/SDL/SDLInput.cpp index 9c4305676..76476f162 100644 --- a/Source/Engine/Platform/SDL/SDLInput.cpp +++ b/Source/Engine/Platform/SDL/SDLInput.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #if PLATFORM_SDL diff --git a/Source/Engine/Platform/SDL/SDLInput.h b/Source/Engine/Platform/SDL/SDLInput.h index 74a8737b5..cb1e652a0 100644 --- a/Source/Engine/Platform/SDL/SDLInput.h +++ b/Source/Engine/Platform/SDL/SDLInput.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #pragma once diff --git a/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp b/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp index 3d7e72e83..a30034d7a 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp +++ b/Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #if PLATFORM_SDL && PLATFORM_LINUX diff --git a/Source/Engine/Platform/SDL/SDLPlatform.Mac.cpp b/Source/Engine/Platform/SDL/SDLPlatform.Mac.cpp index 6cecca574..5770b56d5 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.Mac.cpp +++ b/Source/Engine/Platform/SDL/SDLPlatform.Mac.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #if PLATFORM_SDL && PLATFORM_MAC diff --git a/Source/Engine/Platform/SDL/SDLPlatform.Windows.cpp b/Source/Engine/Platform/SDL/SDLPlatform.Windows.cpp index a805d51f5..ae841b1b4 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.Windows.cpp +++ b/Source/Engine/Platform/SDL/SDLPlatform.Windows.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #if PLATFORM_SDL && PLATFORM_WINDOWS @@ -111,29 +111,30 @@ bool SDLPlatform::EventFilterCallback(void* userdata, SDL_Event* event) else if (event->type == SDL_EVENT_WINDOW_MOVED) { if (window) + { window->HandleEvent(*event); - if (WinImpl::DraggedWindowSize != window->GetClientSize()) - { - // The window size changed while dragging, most likely due to maximized window restoring back to previous size. - WinImpl::DraggedWindowMousePosition = WinImpl::DraggedWindowStartPosition + WinImpl::DraggedWindowMousePosition - window->GetClientPosition(); - WinImpl::DraggedWindowStartPosition = window->GetClientPosition(); - WinImpl::DraggedWindowSize = window->GetClientSize(); - } - Float2 windowPosition = Float2(static_cast(event->window.data1), static_cast(event->window.data2)); - Float2 mousePosition = WinImpl::DraggedWindowMousePosition; + Float2 windowSize = window->GetClientSize(); + if (WinImpl::DraggedWindowSize != windowSize) + { + // The window size changed while dragging, most likely due to maximized window restoring back to previous size. + WinImpl::DraggedWindowMousePosition = WinImpl::DraggedWindowStartPosition + WinImpl::DraggedWindowMousePosition - window->GetClientPosition(); + WinImpl::DraggedWindowStartPosition = window->GetClientPosition(); + WinImpl::DraggedWindowSize = windowSize; + } + Float2 windowPosition = Float2(static_cast(event->window.data1), static_cast(event->window.data2)); + Float2 mousePosition = WinImpl::DraggedWindowMousePosition; - // Generate mouse movement events while dragging the window around - SDL_Event mouseMovedEvent { 0 }; - mouseMovedEvent.motion.type = SDL_EVENT_MOUSE_MOTION; - mouseMovedEvent.motion.windowID = SDL_GetWindowID(WinImpl::DraggedWindow->GetSDLWindow()); - mouseMovedEvent.motion.timestamp = SDL_GetTicksNS(); - mouseMovedEvent.motion.state = SDL_BUTTON_LEFT; - mouseMovedEvent.motion.x = mousePosition.X; - mouseMovedEvent.motion.y = mousePosition.Y; - if (window) + // Generate mouse movement events while dragging the window around + SDL_Event mouseMovedEvent{ 0 }; + mouseMovedEvent.motion.type = SDL_EVENT_MOUSE_MOTION; + mouseMovedEvent.motion.windowID = SDL_GetWindowID(WinImpl::DraggedWindow->GetSDLWindow()); + mouseMovedEvent.motion.timestamp = SDL_GetTicksNS(); + mouseMovedEvent.motion.state = SDL_BUTTON_LEFT; + mouseMovedEvent.motion.x = mousePosition.X; + mouseMovedEvent.motion.y = mousePosition.Y; window->HandleEvent(mouseMovedEvent); - + } return false; } if (window) diff --git a/Source/Engine/Platform/SDL/SDLPlatform.cpp b/Source/Engine/Platform/SDL/SDLPlatform.cpp index 181412319..b673d9c17 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.cpp +++ b/Source/Engine/Platform/SDL/SDLPlatform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #if PLATFORM_SDL diff --git a/Source/Engine/Platform/SDL/SDLPlatform.h b/Source/Engine/Platform/SDL/SDLPlatform.h index b7e556395..842082a37 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.h +++ b/Source/Engine/Platform/SDL/SDLPlatform.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #pragma once diff --git a/Source/Engine/Platform/SDL/SDLWindow.cpp b/Source/Engine/Platform/SDL/SDLWindow.cpp index 13c759b1d..9dc08fc0d 100644 --- a/Source/Engine/Platform/SDL/SDLWindow.cpp +++ b/Source/Engine/Platform/SDL/SDLWindow.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #if PLATFORM_SDL diff --git a/Source/Engine/Platform/SDL/SDLWindow.h b/Source/Engine/Platform/SDL/SDLWindow.h index 24dbc49cc..a84ec24c9 100644 --- a/Source/Engine/Platform/SDL/SDLWindow.h +++ b/Source/Engine/Platform/SDL/SDLWindow.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #pragma once diff --git a/Source/Engine/Platform/ScreenUtilities.h b/Source/Engine/Platform/ScreenUtilities.h index c989d7caf..05678f2da 100644 --- a/Source/Engine/Platform/ScreenUtilities.h +++ b/Source/Engine/Platform/ScreenUtilities.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #pragma once diff --git a/Source/Engine/Platform/Windows/WindowsScreenUtilities.cpp b/Source/Engine/Platform/Windows/WindowsScreenUtilities.cpp index 51f3fa166..440963af6 100644 --- a/Source/Engine/Platform/Windows/WindowsScreenUtilities.cpp +++ b/Source/Engine/Platform/Windows/WindowsScreenUtilities.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #if PLATFORM_WINDOWS diff --git a/Source/Engine/Platform/Windows/WindowsScreenUtilities.h b/Source/Engine/Platform/Windows/WindowsScreenUtilities.h index c7b48f2cb..91abe22fc 100644 --- a/Source/Engine/Platform/Windows/WindowsScreenUtilities.h +++ b/Source/Engine/Platform/Windows/WindowsScreenUtilities.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #pragma once diff --git a/Source/Engine/Platform/Windows/WindowsWindow.DragDrop.cpp b/Source/Engine/Platform/Windows/WindowsWindow.DragDrop.cpp index f98a189c4..1aa5c903e 100644 --- a/Source/Engine/Platform/Windows/WindowsWindow.DragDrop.cpp +++ b/Source/Engine/Platform/Windows/WindowsWindow.DragDrop.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. #if PLATFORM_WINDOWS diff --git a/Source/ThirdParty/SDL/SDL.Build.cs b/Source/ThirdParty/SDL/SDL.Build.cs index 6e917b2c1..91ce939f7 100644 --- a/Source/ThirdParty/SDL/SDL.Build.cs +++ b/Source/ThirdParty/SDL/SDL.Build.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. using System.IO; using Flax.Build; diff --git a/Source/ThirdParty/Wayland/Wayland.Build.cs b/Source/ThirdParty/Wayland/Wayland.Build.cs index 7a2d5d6b8..432396a10 100644 --- a/Source/ThirdParty/Wayland/Wayland.Build.cs +++ b/Source/ThirdParty/Wayland/Wayland.Build.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. using System.Collections.Generic; using System.IO; diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/SDL.cs b/Source/Tools/Flax.Build/Deps/Dependencies/SDL.cs index ad8597873..f47469ee8 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/SDL.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/SDL.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. using System; using System.Collections.Generic; diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/Wayland.cs b/Source/Tools/Flax.Build/Deps/Dependencies/Wayland.cs index b5258a105..ded2c7d6e 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/Wayland.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/Wayland.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. using System.Collections.Generic; using System.IO; diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/libportal.cs b/Source/Tools/Flax.Build/Deps/Dependencies/libportal.cs index 74d3cecb1..7ccd6e242 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/libportal.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/libportal.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +// Copyright (c) Wojciech Figat. All rights reserved. using System.Collections.Generic; using System.IO;