_wayland normal dragging working
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

This commit is contained in:
2025-01-23 23:55:20 +02:00
parent 319d2cbc63
commit 56a17a90de
3 changed files with 32 additions and 18 deletions

View File

@@ -43,6 +43,8 @@ wl_data_device_manager* WaylandDataDeviceManager = nullptr;
xdg_wm_base* WaylandXdgWmBase = nullptr;
wl_data_device* dataDevice;
bool waylandDraggingActive = false;
bool waylandDraggingWindow = false;
StringView waylandDraggingData = nullptr;
// X11
Delegate<void*> LinuxPlatform::xEventReceived;
@@ -640,7 +642,7 @@ public:
textData.Window = window;
textData.dragOver = &dragOver;
auto _window = window->GetSDLWindow();
auto _mainwindow = dragSourceWindow->GetSDLWindow();
auto _mainwindow = dragSourceWindow != nullptr ? dragSourceWindow->GetSDLWindow() : _window;
//if (!window->IsVisible())
// _window = mainwindow->GetSDLWindow();
//wl_data_source_set_user_data(wrappedDataSource, &textData);
@@ -845,6 +847,8 @@ DragDropEffect Window::DoDragDropWayland(const StringView& data, Window* dragSou
}
waylandDraggingActive = true;
waylandDraggingWindow = data == String("notawindow");
waylandDraggingData = StringView(data.Get(), data.Length());
auto task = New<WaylandDragDropJob>();
task->data = data;
@@ -889,6 +893,8 @@ DragDropEffect Window::DoDragDropWayland(const StringView& data, Window* dragSou
task->Wait();
waylandDraggingActive = false;
waylandDraggingWindow = false;
waylandDraggingData = nullptr;
return DragDropEffect::None;
}