raboof/volare
6
22
Fork
You've already forked volare
2

Two tiling drag fixes #43

Merged
raboof merged 2 commits from :edmonds/tiling-drag-fixes into main 2023年06月09日 08:28:22 +02:00
Collaborator
Copy link

This branch has two fixes for handle_motion_postthreshold() in sway/input/seatop_move_tiling.c. The first commit fixes #42 in certain situations where a window in a tabbed container is being dragged onto itself, and the second commit is a cleanup that removes what should be some unnecessary container traversal code.

This branch has two fixes for `handle_motion_postthreshold()` in `sway/input/seatop_move_tiling.c`. The first commit fixes #42 in certain situations where a window in a tabbed container is being dragged onto itself, and the second commit is a cleanup that removes what should be some unnecessary container traversal code.
In `handle_motion_postthreshold()`, not all cases of dragging a
container onto itself will be caught. This commit adds an explicit check
to deny a move operation if the container being dragged is the same as
the container under the mouse cursor. If this case isn't caught, the
container being dragged will disappear from the layout.
Previously, in commit 4d4611f8 ("seatop_move_tiling: Special case
handling of tabbed containers"), `L_TABBED` containers were handled
specially, by traversing all the ancestors of the container being
hovered looking for the first `L_TABBED` container.
Originally, I thought this traversal was necessary since the mouse
cursor might be over an application window in a tabbed container and we
would want the parent container of that window, so I copied the
traversal logic from later in the same function ("// Traverse the
ancestors"). However, after debugging the issue in the previous commit
("seatop_move_tiling: Don't allow moving a container onto itself") and
looking at this more closely it appears that `node_at_coords()` is
already doing the work to find the parent container of the window under
the mouse cursor.
(In other words, if the cursor is hovering over an application window
inside an `L_TABBED` container, I believe `node_at_coords()` will return
the parent `L_TABBED` container, not the node of the application
window.)
This commit simplifies the handling of tabbed containers in
`handle_motion_postthreshold()` by only considering the hovered
`L_TABBED` container rather than traversing all of the hovered node's
ancestors.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
raboof/volare!43
Reference in a new issue
raboof/volare
No description provided.
Delete branch ":edmonds/tiling-drag-fixes"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?