xwayland: improve dnd and cleanup (#9405)

Minor changes to xwayland dnd / regular dnd to fix various issues

---------

Co-authored-by: Vaxry <vaxry@vaxry.net>
This commit is contained in:
nyx 2025-02-23 21:52:10 -05:00 committed by GitHub
parent e59464629f
commit 3458d7ac93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 177 additions and 96 deletions

View file

@ -1,8 +1,11 @@
#pragma once
#include "../protocols/types/DataDevice.hpp"
#include "../managers/SeatManager.hpp"
#include "../managers/input/InputManager.hpp"
#include <wayland-server-protocol.h>
#include <hyprutils/os/FileDescriptor.hpp>
#include <xcb/xcb.h>
#define XDND_VERSION 5
@ -72,10 +75,16 @@ class CX11DataDevice : public IDataDevice {
virtual void sendDrop();
virtual void sendSelection(SP<IDataOffer> offer);
virtual eDataSourceType type();
void forceCleanupDnd();
WP<CX11DataDevice> self;
private:
void cleanupState();
#ifndef NO_XWAYLAND
xcb_window_t getProxyWindow(xcb_window_t window);
void sendDndEvent(xcb_window_t targetWindow, xcb_atom_t type, xcb_client_message_data_t& data);
#endif
WP<CXWaylandSurface> lastSurface;
WP<IDataOffer> lastOffer;
Vector2D lastSurfaceCoords;