7 Commits

Author SHA1 Message Date
ed4d5a5397 _drag release offset investigation
Some checks failed
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled
2025-01-12 22:15:38 +02:00
1b9c9436bc _wayland dragging completed 2025-01-11 22:53:25 +02:00
ec94cda27b Revert "_TEST X11"
This reverts commit 19852273b7.
2025-01-11 20:21:28 +02:00
19852273b7 _TEST X11 2025-01-11 12:39:37 +02:00
62d99b18cd _x11 fixes 2025-01-11 12:39:37 +02:00
3a04326bfd Update SDL3 2025-01-11 12:39:37 +02:00
ce5cfa6b21 _wayland dragging good 2025-01-11 12:39:37 +02:00
29 changed files with 305 additions and 148 deletions

View File

@@ -25,7 +25,7 @@ namespace FlaxEditor.GUI.Docking
private Rectangle _rLeft, _rRight, _rBottom, _rUpper, _rCenter;
private DockHintWindow(FloatWindowDockPanel toMove, bool lateDragStart)
private DockHintWindow(FloatWindowDockPanel toMove, bool draggingTab)
{
_toMove = toMove;
_toSet = DockState.Float;
@@ -47,11 +47,7 @@ namespace FlaxEditor.GUI.Docking
window.Restore();
window.Position = Platform.MousePosition - mousePos * window.Size / previousSize;
}
// Calculate dragging offset and move window to the destination position
var mouseClientPosition = Platform.MousePosition;
CalculateDragOffset(mouseClientPosition);
// If the _toMove window was not focused when initializing this window, the result vector only contains zeros
// and to prevent a failure, we need to perform an update for the drag offset at later time which will be done in the OnMouseMove event handler.
//if (mouseScreenPosition != Float2.Zero)
@@ -92,17 +88,23 @@ namespace FlaxEditor.GUI.Docking
// Hide base window
//window.Hide();
if (lateDragStart)
// window.Show();
if (draggingTab)
{
// The window needs some time to be fully ready for dragging
//_lateDragStartTimer = 1.5f;
window.StartDragging(_dragOffset);
_dragOffset = new Float2(window.Size.X / 2, 10.0f);
window.StartDragging(_dragOffset, toMove.MasterPanel?.RootWindow.Window ?? Editor.Instance.Windows.MainWindow);
}
else
window.StartDragging(_dragOffset);
{
var mouseClientPosition = Platform.MousePosition;
CalculateDragOffset(mouseClientPosition);
window.StartDragging(_dragOffset, window);
}
//window.Show();
//window.BringToFront();
//window.Focus();
@@ -340,7 +342,7 @@ namespace FlaxEditor.GUI.Docking
if (dockPanel != _toDock)
{
//Editor.Log($"UpdateRects: {_mouse}, panel: {dockPanel?.RootWindow?.Window?.Title}");
Editor.Log($"UpdateRects: {_mouse}, panel: {dockPanel?.RootWindow?.Window?.Title}");
_toDock?.RootWindow.Window.RemoveDockHints();
RemoveDockHints();
@@ -420,8 +422,8 @@ namespace FlaxEditor.GUI.Docking
hoveredSizeOverride = new Float2(size.X, size.Y);
}
if (toSet != DockState.Float)
Editor.Log($"docking: {toSet}");
//if (toSet != DockState.Float)
_toSet = toSet;
}
@@ -429,6 +431,8 @@ namespace FlaxEditor.GUI.Docking
{
_toSet = DockState.Float;
}
Editor.Log($"docking: {_toSet}, pos: {_mouse}");
// Calculate proxy/dock/window rectangles
if (_toDock == null)
@@ -519,15 +523,10 @@ namespace FlaxEditor.GUI.Docking
private void OnUpdate()
{
//Editor.Log("OnUpdate");
if (_lateDragStartTimer > 0)
{
_lateDragStartTimer -= Time.UnscaledDeltaTime;
if (_lateDragStartTimer <= 0)
_toMove.Window.Window.StartDragging(_dragOffset);
}
var mousePos = Platform.MousePosition;
if (_mouse != mousePos)
{
Editor.Log($"mouse pos {_mouse} -> {mousePos}");
OnMouseMove(mousePos);
}
}

View File

@@ -51,9 +51,9 @@ namespace FlaxEditor.GUI.Docking
if (_window == null)
return;
_window.Window.StartDragging(Float2.Zero);
// Create docking hint window
//DockHintWindow.Create(this);
DockHintWindow.Create(this);
//_window.Window.StartDragging(Float2.Zero);
}
/// <summary>

View File

@@ -1017,7 +1017,7 @@ namespace FlaxEditor.Modules
if (_lastLayoutSaveTime.Ticks > 10 && now - _lastLayoutSaveTime >= TimeSpan.FromSeconds(10))
{
Profiler.BeginEvent("Save Layout");
SaveCurrentLayout();
//SaveCurrentLayout();
Profiler.EndEvent();
}

View File

@@ -16,6 +16,7 @@ API_CLASS(Static) class FLAXENGINE_API Time
friend class Engine;
friend class TimeService;
friend class PhysicsSettings;
friend class SDLWindow;
public:
/// <summary>

View File

@@ -741,7 +741,8 @@ public:
/// Start dragging the window.
/// </summary>
/// <param name="offset">The position offset for drag from top-left corner.</param>
API_FUNCTION() virtual void StartDragging(const Float2& offset)
/// <param name="dragSourceWindow">The source window where the dragging is started from. For attached tabs, this is the parent window</param>
API_FUNCTION() virtual void StartDragging(const Float2& offset, Window* dragSourceWindow)
{
}

View File

@@ -1,5 +1,6 @@
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
#include "Engine/Engine/Engine.h"
#if PLATFORM_SDL
#include "SDLInput.h"
@@ -496,14 +497,17 @@ bool SDLInput::HandleEvent(SDLWindow* window, SDL_Event& event)
}
return true;
}
case SDL_EVENT_DROP_POSITION:
/*case SDL_EVENT_DROP_POSITION:
{
// We are not receiving mouse motion events during drag-and-drop
auto dpiScale = window->GetDpiScale();
const Float2 mousePos = window->ClientToScreen({ event.drop.x * dpiScale, event.drop.y * dpiScale});
//const Float2 mousePos(event.drop.x * dpiScale, event.drop.y * dpiScale);// = window->ClientToScreen({ event.drop.x * dpiScale, event.drop.y * dpiScale});
Float2 mousePos = window->ClientToScreen({ event.drop.x * dpiScale, event.drop.y * dpiScale});
if (window != Engine::MainWindow)
mousePos = window->GetPosition() - mousePos;
Input::Mouse->OnMouseMove(mousePos, window);
return true;
}
}*/
case SDL_EVENT_WINDOW_MOUSE_LEAVE:
{
Input::Mouse->OnMouseLeave(window);

View File

@@ -2,6 +2,8 @@
#include <errno.h>
#include "Engine/Engine/Time.h"
#include "Engine/Graphics/RenderTask.h"
#include "Engine/Platform/Base/DragDropHelper.h"
#include "Engine/Platform/Unix/UnixFile.h"
@@ -497,8 +499,8 @@ void WaylandDataSource_Cancelled(void* data, wl_data_source *source)
wl_data_source_destroy(source);
// The mouse up event was ignored earlier, release the button now
SDLWindow* window = ((LinuxDropTextData*)inputData)->Window;
Input::Mouse->OnMouseUp(Platform::GetMousePosition(), MouseButton::Left, window);
//SDLWindow* window = ((LinuxDropTextData*)inputData)->Window;
//Input::Mouse->OnMouseUp(Platform::GetMousePosition(), MouseButton::Left, window);
/*if (DragTargetWindow != nullptr)
{
@@ -515,7 +517,7 @@ void WaylandDataSource_DnDDropPerformed(void *data,
{
// The destination is being asked to begin DnD, asking confirmation with ASK actionh
//SDLWindow* window = static_cast<SDLWindow*>(data);
//LOG(Info, "WaylandDataSource_DnDDropPerformed");
LOG(Info, "WaylandDataSource_DnDDropPerformed");
}
void WaylandDataSource_DnDFinished(void *data,
@@ -531,8 +533,8 @@ void WaylandDataSource_DnDFinished(void *data,
wl_data_source_destroy(wl_data_source);
// The mouse up event was ignored earlier, release the button now
SDLWindow* window = ((LinuxDropTextData*)inputData)->Window;
Input::Mouse->OnMouseUp(Platform::GetMousePosition(), MouseButton::Left, window);
//SDLWindow* window = ((LinuxDropTextData*)inputData)->Window;
//Input::Mouse->OnMouseUp(Platform::GetMousePosition(), MouseButton::Left, window);
/*if (DragTargetWindow != nullptr)
{
@@ -576,14 +578,15 @@ public:
int64 ExitFlag = 0;
StringView data;
SDLWindow* window;
SDLWindow* dragSourceWindow;
Float2 dragOffset = Float2::Zero;
int64 dragOver = 0;
int64 waitFlag = 0;
// [ThreadPoolTask]
bool Run() override
{
Scripting::GetScriptsDomain()->Dispatch();
bool dragWindow = data == String("notawindow");
wl_display* wrappedDisplay = WaylandDisplay;//(wl_display*)wl_proxy_create_wrapper(WaylandDisplay);
//wl_proxy_set_queue((wl_proxy*)wrappedDisplay, queue);
@@ -614,7 +617,7 @@ public:
/*auto */dataDevice = wl_data_device_manager_get_data_device(wrappedManager, WaylandSeat);
wl_data_device_add_listener(dataDevice, &WaylandDataDeviceListener, nullptr);
wl_display_roundtrip(wrappedDisplay);
wl_data_device_set_user_data(dataDevice, window);
wl_data_device_set_user_data(dataDevice, dragWindow ? dragSourceWindow : window);
wrappedDataDevice = (wl_data_device*)wl_proxy_create_wrapper(dataDevice);
wl_proxy_set_queue((wl_proxy*)wrappedDataDevice, WaylandQueue);
}
@@ -623,7 +626,7 @@ public:
dataSource = wl_data_device_manager_create_data_source(wrappedManager);
wrappedDataSource = (wl_data_source*)wl_proxy_create_wrapper(dataSource);
wl_proxy_set_queue((wl_proxy*)wrappedDataSource, WaylandQueue);
if (data == String("awindow"))
if (dragWindow)
{
wl_data_source_offer(dataSource, "flaxengine/window");
wl_data_source_offer(dataSource, "text/plain;charset=utf-8"); // TODO: needs support for custom mime-types in SDL
@@ -641,6 +644,9 @@ public:
textData.Window = window;
textData.dragOver = &dragOver;
auto _window = window->GetSDLWindow();
auto _mainwindow = dragSourceWindow->GetSDLWindow();
//if (!window->IsVisible())
// _window = mainwindow->GetSDLWindow();
//wl_data_source_set_user_data(wrappedDataSource, &textData);
wl_data_source_add_listener(dataSource, &WaylandDataSourceListener, &textData);
@@ -660,13 +666,13 @@ public:
xdg_toplevel* wrappedToplevel = nullptr;
{
wl_surface* origin = (wl_surface*)SDL_GetPointerProperty(SDL_GetWindowProperties(_window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, nullptr);
wl_surface* origin = (wl_surface*)SDL_GetPointerProperty(SDL_GetWindowProperties(_mainwindow), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, nullptr);
wl_surface* icon = nullptr;
uint32 id = ImplicitGrabSerial;
//id = (uint32)SDL_GetNumberProperty(SDL_GetGlobalProperties(), "wayland.serial", 0);
wl_data_device_start_drag((wl_data_device*)SDL_GetPointerProperty(SDL_GetGlobalProperties(), "wayland.data_device", wrappedDataDevice), dataSource, origin, icon, id);
if (data == String("awindow"))
if (dragWindow)
{
if (toplevel != nullptr)
{
@@ -674,8 +680,7 @@ public:
wl_proxy_set_queue((wl_proxy*)wrappedToplevel, WaylandQueue);
toplevelDrag = xdg_toplevel_drag_manager_v1_get_xdg_toplevel_drag(DragManager, dataSource);
Float2 offset(100, 240);
Float2 scaledOffset = offset / window->GetDpiScale();
Float2 scaledOffset = dragOffset / window->GetDpiScale();
//xdg_toplevel_drag_v1_attach(toplevelDrag, toplevel, (int32)scaledOffset.X, (int32)scaledOffset.Y);
xdg_toplevel_drag_v1_attach(toplevelDrag, wrappedToplevel, (int32)scaledOffset.X, (int32)scaledOffset.Y);
@@ -729,7 +734,7 @@ public:
if (wl_display_roundtrip_queue(wrappedDisplay, WaylandQueue) == -1)
LOG(Warning, "err wl_display_roundtrip_queue: {}", errno);
if (toplevel == nullptr && data == String("awindow"))
if (toplevel == nullptr && dragWindow)
{
if (Platform::AtomicRead(&waitFlag) != 0)
{
@@ -740,8 +745,7 @@ public:
wl_proxy_set_queue((wl_proxy*)wrappedToplevel, WaylandQueue);
toplevelDrag = xdg_toplevel_drag_manager_v1_get_xdg_toplevel_drag(DragManager, dataSource);
Float2 offset(100, 240);
Float2 scaledOffset = offset / window->GetDpiScale();
Float2 scaledOffset = dragOffset / window->GetDpiScale();
//xdg_toplevel_drag_v1_attach(toplevelDrag, toplevel, (int32)scaledOffset.X, (int32)scaledOffset.Y);
xdg_toplevel_drag_v1_attach(toplevelDrag, wrappedToplevel, (int32)scaledOffset.X, (int32)scaledOffset.Y);
@@ -806,17 +810,52 @@ public:
}
};
DragDropEffect Window::DoDragDropWayland(const StringView& data)
DragDropEffect Window::DoDragDropWayland(const StringView& data, Window* dragSourceWindow, Float2 dragOffset)
{
// For drag-and-drop, we need to setup the event queue in separate thread to avoid racing issues
// while SDL is dispatching the main Wayland event queue when receiving the data offer from us.
// Show()?
{
if (!_visible)
{
if (_showAfterFirstPaint)
{
if (RenderTask)
RenderTask->Enabled = true;
}
else
SDL_ShowWindow(_window);
}
WindowBase::Show();
}
//while (true)
{
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);
}
waylandDraggingActive = true;
auto task = New<WaylandDragDropJob>();
task->data = data;
task->window = this;
task->dragSourceWindow = dragSourceWindow; // Needs to be the parent window when dragging a tab to window
task->dragOver = 0;
task->dragOffset = dragOffset;
Task::StartNew(task);
while (task->GetState() == TaskState::Queued)
Platform::Sleep(1);
@@ -826,14 +865,14 @@ DragDropEffect Window::DoDragDropWayland(const StringView& data)
Platform::Sleep(1);
}
Show();
//Show();
//Focus();
int counter = 100;
while (Platform::AtomicRead(&task->dragOver) == 0)
{
SDLPlatform::Tick();
Engine::OnUpdate(); // For docking updates
Engine::OnUpdate();//Scripting::Update(); // For docking updates
Engine::OnDraw();
Platform::Sleep(1);
@@ -847,6 +886,9 @@ DragDropEffect Window::DoDragDropWayland(const StringView& data)
}
}
// The mouse up event was ignored earlier, release the button now
Input::Mouse->OnMouseUp(Platform::GetMousePosition(), MouseButton::Left, this);
Platform::AtomicStore(&task->ExitFlag, 1);
task->Wait();
@@ -1563,6 +1605,11 @@ void SDLPlatform::SetHighDpiAwarenessEnabled(bool enable)
bool SDLPlatform::UsesWayland()
{
if (xDisplay == nullptr && WaylandDisplay == nullptr)
{
// In case the X11 display pointer has not been updated yet
return strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0;
}
return WaylandDisplay != nullptr;
}
@@ -1578,6 +1625,11 @@ bool SDLPlatform::UsesXWayland()
bool SDLPlatform::UsesX11()
{
if (xDisplay == nullptr && WaylandDisplay == nullptr)
{
// In case the X11 display pointer has not been updated yet
return strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0;
}
return xDisplay != nullptr;
}
@@ -1720,7 +1772,7 @@ void WaylandRegistryGlobal(void* data, wl_registry *registry, uint32 id, const c
StringAnsi interfaceStr(interface);
//LOG(Info, "WaylandRegistryGlobal id: {}, interface: {}", id, String(interface));
if (interfaceStr == "xdg_toplevel_drag_manager_v1")
DragManager = (xdg_toplevel_drag_manager_v1*)wl_registry_bind(registry, id, &xdg_toplevel_drag_manager_v1_interface, 1U);
DragManager = (xdg_toplevel_drag_manager_v1*)wl_registry_bind(registry, id, &xdg_toplevel_drag_manager_v1_interface, Math::Min(1U, version));
else if (interfaceStr == "wl_seat")
{
WaylandSeat = (wl_seat*)wl_registry_bind(registry, id, &wl_seat_interface, Math::Min(9U, version));

View File

@@ -140,12 +140,12 @@ SDLWindow::SDLWindow(const CreateWindowSettings& settings)
flags |= SDL_WINDOW_RESIZABLE;
if (_settings.IsTopmost)
flags |= SDL_WINDOW_ALWAYS_ON_TOP;
if (_settings.SupportsTransparency)
//if (_settings.SupportsTransparency)
flags |= SDL_WINDOW_TRANSPARENT;
// Disable parenting of child windows as those are always on top of the parent window and never show up in taskbar
//if (_settings.Parent != nullptr && (_settings.Type != WindowType::Tooltip && _settings.Type != WindowType::Popup))
// _settings.Parent = nullptr;
if (_settings.Parent != nullptr && (_settings.Type != WindowType::Tooltip && _settings.Type != WindowType::Popup))
_settings.Parent = nullptr;
if (_settings.Parent != nullptr && _settings.Parent->_settings.Type != WindowType::Regular && (_settings.Type == WindowType::Tooltip || _settings.Type == WindowType::Popup))
{
@@ -640,16 +640,41 @@ void SDLWindow::HandleEvent(SDL_Event& event)
return;
}
case SDL_EVENT_DROP_BEGIN:
case SDL_EVENT_DROP_POSITION:
case SDL_EVENT_DROP_FILE:
case SDL_EVENT_DROP_TEXT:
case SDL_EVENT_DROP_COMPLETE:
{
LOG(Info, "SDL_EVENT_DROP_BEGIN");
//LOG(Info, "SDL_EVENT_DROP_BEGIN");
static Float2 dragStartPosition = Float2::Zero;
auto dpiScale = GetDpiScale();
const Float2 mousePos = ClientToScreen({ event.drop.x * dpiScale, event.drop.y * dpiScale});
//const Float2 mousePos = ClientToScreen({ event.drop.x * dpiScale, event.drop.y * dpiScale});
const Float2 mousePos = dragStartPosition + Float2(event.drop.x * dpiScale, event.drop.y * dpiScale);
DragDropEffect effect = DragDropEffect::None;
auto daata = event.drop.data;
SDLDropTextData dropData;
OnDragEnter(&dropData, mousePos, effect);
if (event.type == SDL_EVENT_DROP_BEGIN)
{
dragStartPosition = Platform::GetMousePosition();
OnDragEnter(&dropData, mousePos, effect);
}
else if (event.type == SDL_EVENT_DROP_POSITION)
{
Input::Mouse->OnMouseMove(mousePos, this);
OnDragOver(&dropData, mousePos, effect);
}
else if (event.type == SDL_EVENT_DROP_FILE)
OnDragDrop(&dropData, mousePos, effect);
else if (event.type == SDL_EVENT_DROP_TEXT)
OnDragDrop(&dropData, mousePos, effect);
else if (event.type == SDL_EVENT_DROP_COMPLETE)
OnDragLeave();
/*Focus();
Float2 mousePosition;
SDL_GetGlobalMouseState(&mousePosition.X, &mousePosition.Y);
@@ -659,21 +684,19 @@ void SDLWindow::HandleEvent(SDL_Event& event)
SDLDropTextData dropData;
OnDragEnter(&dropData, mousePosition, effect);
OnDragOver(&dropData, mousePosition, effect);*/
return;
break;
}
case SDL_EVENT_DROP_POSITION:
/*case SDL_EVENT_DROP_POSITION:
{
auto dpiScale = GetDpiScale();
const Float2 mousePos = ClientToScreen({ event.drop.x * dpiScale, event.drop.y * dpiScale});
//const Float2 mousePos = ClientToScreen({ event.drop.x * dpiScale, event.drop.y * dpiScale});
const Float2 mousePos(event.drop.x * dpiScale, event.drop.y * dpiScale);
DragDropEffect effect = DragDropEffect::None;
auto daata = event.drop.data;
SDLDropTextData dropData;
OnDragOver(&dropData, mousePos, effect);
/*DragDropEffect effect = DragDropEffect::None;
SDLDropTextData dropData;
OnDragOver(&dropData, Float2(static_cast<float>(event.drop.x), static_cast<float>(event.drop.y)), effect);*/
break;
}
case SDL_EVENT_DROP_FILE:
@@ -688,16 +711,7 @@ void SDLWindow::HandleEvent(SDL_Event& event)
OnDragDrop(&dropData, mousePos, effect);
/*SDLDropFilesData dropData;
dropData.Files.Add(StringAnsi(event.drop.data).ToString()); // TODO: collect multiple files at once?
Focus();
Float2 mousePosition;
SDL_GetGlobalMouseState(&mousePosition.X, &mousePosition.Y);
mousePosition = ScreenToClient(mousePosition);
DragDropEffect effect = DragDropEffect::None;
OnDragDrop(&dropData, mousePosition, effect);*/
return;
}
case SDL_EVENT_DROP_TEXT:
@@ -713,16 +727,6 @@ void SDLWindow::HandleEvent(SDL_Event& event)
SDLDropTextData dropData;
OnDragDrop(&dropData, mousePos, effect);
/*SDLDropTextData dropData;
String str = StringAnsi(event.drop.data).ToString();
dropData.Text = StringView(str);
Focus();
Float2 mousePosition;
SDL_GetGlobalMouseState(&mousePosition.X, &mousePosition.Y);
mousePosition = ScreenToClient(mousePosition);
DragDropEffect effect = DragDropEffect::None;
OnDragDrop(&dropData, mousePosition, effect);*/
return;
}
case SDL_EVENT_DROP_COMPLETE:
@@ -740,7 +744,7 @@ void SDLWindow::HandleEvent(SDL_Event& event)
//_dragOver = false;
}
return;
}
}*/
#endif
case SDL_EVENT_WINDOW_MOUSE_LEAVE:
{
@@ -925,10 +929,10 @@ bool SDLWindow::IsForegroundWindow() const
void SDLWindow::BringToFront(bool force)
{
auto activateWhenRaised = SDL_GetHint(SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED);
/*auto activateWhenRaised = SDL_GetHint(SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED);
SDL_SetHint(SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED, "0");
SDL_RaiseWindow(_window);
SDL_SetHint(SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED, activateWhenRaised);
SDL_SetHint(SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED, activateWhenRaised);*/
}
void SDLWindow::SetClientBounds(const Rectangle& clientArea)
@@ -1299,11 +1303,26 @@ void SDLWindow::UpdateCursor()
wl_display_flush((wl_display*)SDL_GetPointerProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, nullptr));
}*/
void SDLWindow::StartDragging(const Float2& offset)
void SDLWindow::StartDragging(const Float2& offset, Window* dragSourceWindow)
{
LOG(Info, "StartDragging {}", offset);
DoDragDropWayland(String("awindow"));
Float2 dragOffset = offset;
if (_settings.HasBorder)
{
#if PLATFORM_LINUX
if (SDLPlatform::UsesWayland() && dragSourceWindow == this)
{
// Wayland includes the decorations in the client-space coordinates, adjust the offset for it.
// Assume the title decoration is 25px thick...
float topOffset = 25.0f;
dragOffset += Float2(0.0f, topOffset);
}
#endif
}
SetOpacity(0.1f);
DoDragDropWayland(String("notawindow"), dragSourceWindow, dragOffset);
/*
_dragOver = true;
@@ -1339,6 +1358,8 @@ void SDLWindow::StartDragging(const Float2& offset)
void SDLWindow::StopDragging()
{
LOG(Info, "StopDragging");
SetOpacity(1.0f);
/*
wl_data_device_set_user_data(dataDevice, nullptr);
_dragOver = false;

View File

@@ -62,7 +62,7 @@ private:
void UpdateCursor();
#if PLATFORM_LINUX
DragDropEffect DoDragDropWayland(const StringView& data);
DragDropEffect DoDragDropWayland(const StringView& data, Window* dragSourceWindow = nullptr, Float2 dragOffset = Float2::Zero);
DragDropEffect DoDragDropX11(const StringView& data);
#endif
@@ -108,7 +108,7 @@ public:
void StartClippingCursor(const Rectangle& bounds) override;
void EndClippingCursor() override;
void SetCursor(CursorType type) override;
void StartDragging(const Float2& offset) override;
void StartDragging(const Float2& offset, Window* dragSourceWindow) override;
void StopDragging() override;
#if USE_EDITOR && PLATFORM_WINDOWS

View File

@@ -20,7 +20,7 @@
*/
/**
* Main include header for the SDL library, version 3.1.7
* Main include header for the SDL library, version 3.1.9
*
* It is almost always best to include just this one header instead of
* picking out individual headers included here. There are exceptions to

View File

@@ -127,10 +127,12 @@ extern "C" {
*/
#define SDL_TriggerBreakpoint() TriggerABreakpointInAPlatformSpecificManner
#elif defined(_MSC_VER)
#elif defined(_MSC_VER) && _MSC_VER >= 1310
/* Don't include intrin.h here because it contains C++ code */
extern void __cdecl __debugbreak(void);
#define SDL_TriggerBreakpoint() __debugbreak()
#elif defined(_MSC_VER) && defined(_M_IX86)
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
#elif defined(ANDROID)
#include <assert.h>
#define SDL_TriggerBreakpoint() assert(0)

View File

@@ -213,7 +213,7 @@ typedef struct SDL_AsyncIOQueue SDL_AsyncIOQueue;
* \returns a pointer to the SDL_AsyncIO structure that is created or NULL on
* failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_CloseAsyncIO
* \sa SDL_ReadAsyncIO
@@ -234,7 +234,7 @@ extern SDL_DECLSPEC SDL_AsyncIO * SDLCALL SDL_AsyncIOFromFile(const char *file,
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*/
extern SDL_DECLSPEC Sint64 SDLCALL SDL_GetAsyncIOSize(SDL_AsyncIO *asyncio);
@@ -269,7 +269,7 @@ extern SDL_DECLSPEC Sint64 SDLCALL SDL_GetAsyncIOSize(SDL_AsyncIO *asyncio);
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_WriteAsyncIO
* \sa SDL_CreateAsyncIOQueue
@@ -306,7 +306,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_ReadAsyncIO(SDL_AsyncIO *asyncio, void *ptr
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_ReadAsyncIO
* \sa SDL_CreateAsyncIOQueue
@@ -358,7 +358,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WriteAsyncIO(SDL_AsyncIO *asyncio, void *pt
* \threadsafety It is safe to call this function from any thread, but two
* threads should not attempt to close the same object.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_CloseAsyncIO(SDL_AsyncIO *asyncio, bool flush, SDL_AsyncIOQueue *queue, void *userdata);
@@ -373,7 +373,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_CloseAsyncIO(SDL_AsyncIO *asyncio, bool flu
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_DestroyAsyncIOQueue
* \sa SDL_GetAsyncIOResult
@@ -407,7 +407,7 @@ extern SDL_DECLSPEC SDL_AsyncIOQueue * SDLCALL SDL_CreateAsyncIOQueue(void);
* no other thread is waiting on the queue with
* SDL_WaitAsyncIOResult.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*/
extern SDL_DECLSPEC void SDLCALL SDL_DestroyAsyncIOQueue(SDL_AsyncIOQueue *queue);
@@ -431,7 +431,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyAsyncIOQueue(SDL_AsyncIOQueue *queue
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_WaitAsyncIOResult
*/
@@ -475,7 +475,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetAsyncIOResult(SDL_AsyncIOQueue *queue, S
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_SignalAsyncIOQueue
*/
@@ -499,7 +499,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WaitAsyncIOResult(SDL_AsyncIOQueue *queue,
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_WaitAsyncIOResult
*/
@@ -531,7 +531,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SignalAsyncIOQueue(SDL_AsyncIOQueue *queue)
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_LoadFile_IO
*/

View File

@@ -745,7 +745,7 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDevic
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_IsAudioDevicePhysical(SDL_AudioDeviceID devid);
@@ -759,7 +759,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_IsAudioDevicePhysical(SDL_AudioDeviceID dev
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_IsAudioDevicePlayback(SDL_AudioDeviceID devid);
@@ -1577,6 +1577,26 @@ extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *str
*/
extern SDL_DECLSPEC bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream);
/**
* Use this function to query if an audio device associated with a stream is
* paused.
*
* Unlike in SDL2, audio devices start in an _unpaused_ state, since an app
* has to bind a stream before any audio will flow.
*
* \param stream the audio stream associated with the audio device to query.
* \returns true if device is valid and paused, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_PauseAudioStreamDevice
* \sa SDL_ResumeAudioStreamDevice
*/
extern SDL_DECLSPEC bool SDLCALL SDL_AudioStreamDevicePaused(SDL_AudioStream *stream);
/**
* Lock an audio stream for serialized access.
*

View File

@@ -78,7 +78,7 @@ SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
return -1;
}
return _SDL_bsr_watcom(x);
#elif defined(_MSC_VER)
#elif defined(_MSC_VER) && _MSC_VER >= 1400
unsigned long index;
if (_BitScanReverse(&index, x)) {
return (int)index;

View File

@@ -312,7 +312,7 @@ typedef enum SDL_FileDialogType
* callback may be invoked from the same thread or from a
* different one, depending on the OS's constraints.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_FileDialogType
* \sa SDL_DialogFileCallback

View File

@@ -484,7 +484,7 @@ extern SDL_DECLSPEC char ** SDLCALL SDL_GlobDirectory(const char *path, const ch
* platform-dependent notation. NULL if there's a problem. This
* should be freed with SDL_free() when it is no longer needed.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*/
extern SDL_DECLSPEC char * SDLCALL SDL_GetCurrentDirectory(void);

View File

@@ -2118,7 +2118,7 @@ extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice(
* provide SPIR-V shaders if applicable.
* - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOLEAN`: The app is able to
* provide DXBC shaders if applicable
* `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOLEAN`: The app is able to
* - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOLEAN`: The app is able to
* provide DXIL shaders if applicable.
* - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOLEAN`: The app is able to
* provide MSL shaders if applicable.
@@ -3664,7 +3664,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetGPUSwapchainParameters(
* \returns true if successful, false on error; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*/
extern SDL_DECLSPEC bool SDLCALL SDL_SetGPUAllowedFramesInFlight(
SDL_GPUDevice *device,
@@ -3749,7 +3749,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_AcquireGPUSwapchainTexture(
* \threadsafety This function should only be called from the thread that
* created the window.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_AcquireGPUSwapchainTexture
* \sa SDL_WaitAndAcquireGPUSwapchainTexture
@@ -3792,7 +3792,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WaitForGPUSwapchain(
* \threadsafety This function should only be called from the thread that
* created the window.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_SubmitGPUCommandBuffer
* \sa SDL_SubmitGPUCommandBufferAndAcquireFence

View File

@@ -313,7 +313,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_Quit(void);
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_RunOnMainThread
*/
@@ -350,7 +350,7 @@ typedef void (SDLCALL *SDL_MainThreadCallback)(void *userdata);
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_IsMainThread
*/

View File

@@ -703,7 +703,7 @@ extern SDL_DECLSPEC void * SDLCALL SDL_LoadFile(const char *file, size_t *datasi
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_SaveFile
* \sa SDL_LoadFile_IO
@@ -713,14 +713,14 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SaveFile_IO(SDL_IOStream *src, const void *
/**
* Save all the data into a file path.
*
* \param file the path to read all available data from.
* \param file the path to write all available data into.
* \param data the data to be written. If datasize is 0, may be NULL or a
* invalid pointer.
* \param datasize the number of bytes to be written.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_SaveFile_IO
* \sa SDL_LoadFile

View File

@@ -47,11 +47,15 @@
* A special exception is the number keys at the top of the keyboard which map
* to SDLK_0...SDLK_9 on AZERTY layouts.
*
* Keys with the `SDLK_EXTENDED_MASK` bit set do not map to a scancode or
* unicode code point.
*
* \since This datatype is available since SDL 3.1.3.
*/
typedef Uint32 SDL_Keycode;
#define SDLK_SCANCODE_MASK (1u<<30)
#define SDLK_EXTENDED_MASK (1u << 29)
#define SDLK_SCANCODE_MASK (1u << 30)
#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
#define SDLK_UNKNOWN 0x00000000u /**< 0 */
#define SDLK_RETURN 0x0000000du /**< '\r' */
@@ -302,6 +306,13 @@ typedef Uint32 SDL_Keycode;
#define SDLK_SOFTRIGHT 0x40000120u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT) */
#define SDLK_CALL 0x40000121u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL) */
#define SDLK_ENDCALL 0x40000122u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL) */
#define SDLK_LEFT_TAB 0x20000001u /**< Extended key Left Tab */
#define SDLK_LEVEL5_SHIFT 0x20000002u /**< Extended key Level 5 Shift */
#define SDLK_MULTI_KEY_COMPOSE 0x20000003u /**< Extended key Multi-key Compose */
#define SDLK_LMETA 0x20000004u /**< Extended key Left Meta */
#define SDLK_RMETA 0x20000005u /**< Extended key Right Meta */
#define SDLK_LHYPER 0x20000006u /**< Extended key Left Hyper */
#define SDLK_RHYPER 0x20000007u /**< Extended key Right Hyper */
/**
* Valid key modifiers (possibly OR'd together).
@@ -313,6 +324,7 @@ typedef Uint16 SDL_Keymod;
#define SDL_KMOD_NONE 0x0000u /**< no modifier is applicable. */
#define SDL_KMOD_LSHIFT 0x0001u /**< the left Shift key is down. */
#define SDL_KMOD_RSHIFT 0x0002u /**< the right Shift key is down. */
#define SDL_KMOD_LEVEL5 0x0004u /**< the Level 5 Shift key is down. */
#define SDL_KMOD_LCTRL 0x0040u /**< the left Ctrl (Control) key is down. */
#define SDL_KMOD_RCTRL 0x0080u /**< the right Ctrl (Control) key is down. */
#define SDL_KMOD_LALT 0x0100u /**< the left Alt key is down. */

View File

@@ -366,7 +366,7 @@
*/
#define SDL_WINAPI_FAMILY_PHONE (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
#elif HAVE_WINAPIFAMILY_H && HAVE_WINAPIFAMILY_H
#elif defined(HAVE_WINAPIFAMILY_H) && HAVE_WINAPIFAMILY_H
#define SDL_WINAPI_FAMILY_PHONE (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
#else
#define SDL_WINAPI_FAMILY_PHONE 0

View File

@@ -2110,7 +2110,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer
*
* \threadsafety You may only call this function from the main thread.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_RenderTexture
*/
@@ -2568,7 +2568,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RenderDebugText(SDL_Renderer *renderer, flo
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_RenderDebugText
* \sa SDL_DEBUG_TEXT_FONT_CHARACTER_SIZE

View File

@@ -31,9 +31,9 @@
/* #undef SDL_VENDOR_INFO */
#ifdef SDL_VENDOR_INFO
#define SDL_REVISION "SDL3-3.1.7-preview-3.1.6-637-g8ec576ddab (" SDL_VENDOR_INFO ")"
#define SDL_REVISION "SDL3-3.1.9-preview-3.1.8-43-g82125ec1d (" SDL_VENDOR_INFO ")"
#else
#define SDL_REVISION "SDL3-3.1.7-preview-3.1.6-637-g8ec576ddab"
#define SDL_REVISION "SDL3-3.1.9-preview-3.1.8-43-g82125ec1d"
#endif
#endif /* SDL_revision_h_ */

View File

@@ -107,6 +107,32 @@ void *alloca(size_t);
# endif
#endif
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* Don't let SDL use "long long" C types.
*
* SDL will define this if it believes the compiler doesn't understand the
* "long long" syntax for C datatypes. This can happen on older compilers.
*
* If _your_ compiler doesn't support "long long" but SDL doesn't know it, it
* is safe to define this yourself to build against the SDL headers.
*
* If this is defined, it will remove access to some C runtime support
* functions, like SDL_ulltoa and SDL_strtoll that refer to this datatype
* explicitly. The rest of SDL will still be available.
*
* SDL's own source code cannot be built with a compiler that has this
* defined, for various technical reasons.
*/
#define SDL_NOLONGLONG 1
#elif defined(_MSC_VER) && (_MSC_VER < 1310) /* long long introduced in Visual Studio.NET 2003 */
# define SDL_NOLONGLONG 1
#endif
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
@@ -753,7 +779,9 @@ typedef Sint64 SDL_Time;
#endif
/* Specifically for the `long long` -- SDL-specific. */
#ifdef SDL_PLATFORM_WINDOWS
#ifndef SDL_NOLONGLONG
SDL_COMPILE_TIME_ASSERT(longlong_size64, sizeof(long long) == 8); /* using I64 for windows - make sure `long long` is 64 bits. */
#endif
#define SDL_PRILL_PREFIX "I64"
#else
#define SDL_PRILL_PREFIX "ll"
@@ -1126,8 +1154,10 @@ SDL_COMPILE_TIME_ASSERT(uint32_size, sizeof(Uint32) == 4);
SDL_COMPILE_TIME_ASSERT(sint32_size, sizeof(Sint32) == 4);
SDL_COMPILE_TIME_ASSERT(uint64_size, sizeof(Uint64) == 8);
SDL_COMPILE_TIME_ASSERT(sint64_size, sizeof(Sint64) == 8);
#ifndef SDL_NOLONGLONG
SDL_COMPILE_TIME_ASSERT(uint64_longlong, sizeof(Uint64) <= sizeof(unsigned long long));
SDL_COMPILE_TIME_ASSERT(size_t_longlong, sizeof(size_t) <= sizeof(unsigned long long));
#endif
typedef struct SDL_alignment_test
{
Uint8 a;
@@ -3492,6 +3522,8 @@ extern SDL_DECLSPEC char * SDLCALL SDL_ltoa(long value, char *str, int radix);
*/
extern SDL_DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *str, int radix);
#ifndef SDL_NOLONGLONG
/**
* Convert a long long integer into a string.
*
@@ -3547,6 +3579,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_lltoa(long long value, char *str, int rad
* \sa SDL_ultoa
*/
extern SDL_DECLSPEC char * SDLCALL SDL_ulltoa(unsigned long long value, char *str, int radix);
#endif
/**
* Parse an `int` from a string.
@@ -3660,6 +3693,8 @@ extern SDL_DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int ba
*/
extern SDL_DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base);
#ifndef SDL_NOLONGLONG
/**
* Parse a `long long` from a string.
*
@@ -3726,6 +3761,7 @@ extern SDL_DECLSPEC long long SDLCALL SDL_strtoll(const char *str, char **endp,
* \sa SDL_ulltoa
*/
extern SDL_DECLSPEC unsigned long long SDLCALL SDL_strtoull(const char *str, char **endp, int base);
#endif
/**
* Parse a `double` from a string.

View File

@@ -47,7 +47,7 @@
*
* Consider the following example:
*
* ```
* ```c
* void ReadGameData(void)
* {
* extern char** fileNames;
@@ -115,7 +115,7 @@
* When using, SDL_Storage, these types of problems are virtually impossible
* to trip over:
*
* ```
* ```c
* void ReadGameData(void)
* {
* extern char** fileNames;

View File

@@ -446,7 +446,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status)
* \returns the current state of a thread, or SDL_THREAD_UNKNOWN if the thread
* isn't valid.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_ThreadState
*/

View File

@@ -106,7 +106,7 @@ typedef void (SDLCALL *SDL_TrayCallback)(void *userdata, SDL_TrayEntry *entry);
* UTF-8 encoding. Not supported on all platforms. May be NULL.
* \returns The newly created system tray icon.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_CreateTrayMenu
* \sa SDL_GetTrayMenu
@@ -120,7 +120,7 @@ extern SDL_DECLSPEC SDL_Tray *SDLCALL SDL_CreateTray(SDL_Surface *icon, const ch
* \param tray the tray icon to be updated.
* \param icon the new icon. May be NULL.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_CreateTray
*/
@@ -132,7 +132,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetTrayIcon(SDL_Tray *tray, SDL_Surface *ic
* \param tray the tray icon to be updated.
* \param tooltip the new tooltip in UTF-8 encoding. May be NULL.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_CreateTray
*/
@@ -151,7 +151,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetTrayTooltip(SDL_Tray *tray, const char *
* \param tray the tray to bind the menu to.
* \returns the newly created menu.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_CreateTray
* \sa SDL_GetTrayMenu
@@ -172,7 +172,7 @@ extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_CreateTrayMenu(SDL_Tray *tray);
* \param entry the tray entry to bind the menu to.
* \returns the newly created menu.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_InsertTrayEntryAt
* \sa SDL_GetTraySubmenu
@@ -194,7 +194,7 @@ extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_CreateTraySubmenu(SDL_TrayEntry *e
* \param tray the tray entry to bind the menu to.
* \returns the newly created menu.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_CreateTray
* \sa SDL_CreateTrayMenu
@@ -215,7 +215,7 @@ extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_GetTrayMenu(SDL_Tray *tray);
* \param entry the tray entry to bind the menu to.
* \returns the newly created menu.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_InsertTrayEntryAt
* \sa SDL_CreateTraySubmenu
@@ -232,7 +232,7 @@ extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_GetTraySubmenu(SDL_TrayEntry *entr
* pointer becomes invalid when any function that inserts or deletes
* entries in the menu is called.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_RemoveTrayEntry
* \sa SDL_InsertTrayEntryAt
@@ -244,7 +244,7 @@ extern SDL_DECLSPEC const SDL_TrayEntry **SDLCALL SDL_GetTrayEntries(SDL_TrayMen
*
* \param entry The entry to be deleted.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_GetTrayEntries
* \sa SDL_InsertTrayEntryAt
@@ -267,7 +267,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveTrayEntry(SDL_TrayEntry *entry);
* \param flags a combination of flags, some of which are mandatory.
* \returns the newly created entry, or NULL if pos is out of bounds.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_TrayEntryFlags
* \sa SDL_GetTrayEntries
@@ -287,7 +287,7 @@ extern SDL_DECLSPEC SDL_TrayEntry *SDLCALL SDL_InsertTrayEntryAt(SDL_TrayMenu *m
* \param entry the entry to be updated.
* \param label the new label for the entry in UTF-8 encoding.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_GetTrayEntries
* \sa SDL_InsertTrayEntryAt
@@ -303,7 +303,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetTrayEntryLabel(SDL_TrayEntry *entry, con
* \param entry the entry to be read.
* \returns the label of the entry in UTF-8 encoding.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_GetTrayEntries
* \sa SDL_InsertTrayEntryAt
@@ -320,7 +320,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetTrayEntryLabel(SDL_TrayEntry *ent
* \param checked SDL_TRUE if the entry should be checked; SDL_FALSE
* otherwise.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_GetTrayEntries
* \sa SDL_InsertTrayEntryAt
@@ -336,7 +336,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetTrayEntryChecked(SDL_TrayEntry *entry, b
* \param entry the entry to be read.
* \returns SDL_TRUE if the entry is checked; SDL_FALSE otherwise.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_GetTrayEntries
* \sa SDL_InsertTrayEntryAt
@@ -351,7 +351,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetTrayEntryChecked(SDL_TrayEntry *entry);
* \param enabled SDL_TRUE if the entry should be enabled; SDL_FALSE
* otherwise.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_GetTrayEntries
* \sa SDL_InsertTrayEntryAt
@@ -365,7 +365,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetTrayEntryEnabled(SDL_TrayEntry *entry, b
* \param entry the entry to be read.
* \returns SDL_TRUE if the entry is enabled; SDL_FALSE otherwise.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_GetTrayEntries
* \sa SDL_InsertTrayEntryAt
@@ -381,13 +381,22 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetTrayEntryEnabled(SDL_TrayEntry *entry);
* \param userdata an optional pointer to pass extra data to the callback when
* it will be invoked.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_GetTrayEntries
* \sa SDL_InsertTrayEntryAt
*/
extern SDL_DECLSPEC void SDLCALL SDL_SetTrayEntryCallback(SDL_TrayEntry *entry, SDL_TrayCallback callback, void *userdata);
/**
* Simulate a click on a tray entry.
*
* \param entry The entry to activate.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC void SDLCALL SDL_ClickTrayEntry(SDL_TrayEntry *entry);
/**
* Destroys a tray object.
*
@@ -395,7 +404,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetTrayEntryCallback(SDL_TrayEntry *entry,
*
* \param tray the tray icon to be destroyed.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_CreateTray
*/
@@ -407,7 +416,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyTray(SDL_Tray *tray);
* \param entry the entry for which to get the parent menu.
* \returns the parent menu.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_InsertTrayEntryAt
*/
@@ -423,7 +432,7 @@ extern SDL_DECLSPEC SDL_TrayMenu *SDLCALL SDL_GetTrayEntryParent(SDL_TrayEntry *
* \param menu the menu for which to get the parent entry.
* \returns the parent entry, or NULL if this menu is not a submenu.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_CreateTraySubmenu
* \sa SDL_GetTrayMenuParentTray
@@ -440,7 +449,7 @@ extern SDL_DECLSPEC SDL_TrayEntry *SDLCALL SDL_GetTrayMenuParentEntry(SDL_TrayMe
* \param menu the menu for which to get the parent enttrayry.
* \returns the parent tray, or NULL if this menu is a submenu.
*
* \since This function is available since SDL 3.2.0.
* \since This function is available since SDL 3.1.8.
*
* \sa SDL_CreateTrayMenu
* \sa SDL_GetTrayMenuParentEntry

View File

@@ -62,7 +62,7 @@ extern "C" {
*
* \since This macro is available since SDL 3.1.3.
*/
#define SDL_MICRO_VERSION 7
#define SDL_MICRO_VERSION 9
/**
* This macro turns the version numbers into a numeric value.

View File

@@ -88,8 +88,8 @@ namespace Flax.Deps.Dependencies
Path.Combine(root, "include", "SDL3"),
};
//CloneGitRepoFastSince(root, "https://github.com/libsdl-org/SDL", new DateTime(2025, 01, 06));
//GitResetToCommit(root, "8ec576ddabdc7edfd68e7a8a3214e84e4026328d");
CloneGitRepoFastSince(root, "https://github.com/libsdl-org/SDL", new DateTime(2025, 01, 10));
GitResetToCommit(root, "82125ec1d888e95f838b3cd683dfc8aa54013371");
foreach (var platform in options.Platforms)
{