mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-13 08:22:16 -04:00
data-device: fix dnd handling during popup interactions
When a popup appears during dnd operations in wlroots-based compositors, several issues occur: 1.Drag data is lost 2.Keyboard focus changes unexpectedly 3.Other windows cannot receive drag enter events 4.The compositor may crash in some cases 5.Event propagation is interrupted Forwarding pointer/keyboard events from popup grab to drag grab when drag is active, preventing data loss and maintaining proper event propagation during popup interactions.
This commit is contained in:
parent
b97106ddcb
commit
2e53932337
2 changed files with 67 additions and 2 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include <time.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/types/wlr_compositor.h>
|
||||
#include <wlr/types/wlr_data_device.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "types/wlr_seat.h"
|
||||
|
||||
|
|
@ -416,6 +417,11 @@ void wlr_seat_pointer_start_grab(struct wlr_seat *wlr_seat,
|
|||
grab->seat = wlr_seat;
|
||||
wlr_seat->pointer_state.grab = grab;
|
||||
|
||||
// Preserve drag grab priority
|
||||
if (wlr_seat->drag && grab != &wlr_seat->drag->pointer_grab) {
|
||||
return;
|
||||
}
|
||||
|
||||
wl_signal_emit_mutable(&wlr_seat->events.pointer_grab_begin, grab);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue