This commit is contained in:
Ryan 2026-02-03 21:57:29 -06:00 committed by GitHub
commit f4f6f7a367
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 245 additions and 0 deletions

View file

@ -74,10 +74,22 @@ struct sway_seat_node {
struct wl_listener destroy;
};
struct wlr_xdg_toplevel_drag_v1;
struct sway_drag {
struct sway_seat *seat;
struct wlr_drag *wlr_drag;
struct wlr_xdg_toplevel_drag_v1 *toplevel_drag; // may be NULL
struct wlr_surface *origin; // surface where drag started
// For xdg-toplevel-drag: track the dragged surface ourselves rather than
// trusting wlroots' toplevel pointer, which may not be NULLed promptly
// during destruction sequences. This mirrors Mutter's approach.
struct wlr_surface *toplevel_surface; // the attached toplevel's surface
struct wl_listener toplevel_surface_destroy;
struct wl_listener destroy;
struct wl_listener motion;
};
struct sway_seat {
@ -93,6 +105,14 @@ struct sway_seat {
struct wlr_scene_tree *scene_tree;
struct wlr_scene_tree *drag_icons;
// Container being dragged via xdg-toplevel-drag protocol.
// This container is skipped during hit testing so that
// drop targets underneath can receive pointer focus.
struct sway_container *toplevel_drag_container;
// Origin surface of pending drag (set in request_start_drag, used in start_drag)
struct wlr_surface *pending_drag_origin;
bool has_focus;
struct wl_list focus_stack; // list of containers in focus order
struct sway_workspace *workspace;

View file

@ -123,6 +123,8 @@ struct sway_server {
struct wl_listener request_set_cursor_shape;
struct wlr_xdg_toplevel_drag_manager_v1 *xdg_toplevel_drag_manager;
struct wlr_tearing_control_manager_v1 *tearing_control_v1;
struct wl_listener tearing_control_new_object;
struct wl_list tearing_controllers; // sway_tearing_controller::link

View file

@ -233,6 +233,12 @@ void container_get_box(struct sway_container *container, struct wlr_box *box);
void container_floating_translate(struct sway_container *con,
double x_amount, double y_amount);
/**
* Update scene graph position immediately for a floating container.
* Used during drag operations for smoother visual feedback.
*/
void container_floating_update_scene_position(struct sway_container *con);
/**
* Choose an output for the floating container's new position.
*/