Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving the parent container does not send an IPC window move event #8460

Open
szczescie opened this issue Nov 16, 2024 · 1 comment
Open
Labels
bug Not working as intended

Comments

@szczescie
Copy link

Sway version:
1.10

Debug log:

00:00:13.675 [DEBUG] [sway/commands/bind.c:618] running command for binding: move right
00:00:13.675 [INFO] [sway/commands.c:261] Handling command 'move right'
00:00:13.675 [DEBUG] [sway/commands/move.c:154] Reparenting container (perpendicular)
00:00:13.675 [DEBUG] [sway/commands/move.c:125] Promoting to sibling of cousin
00:00:13.675 [DEBUG] [sway/tree/arrange.c:262] Usable area for ws: 3840x2135@0,25
00:00:13.675 [DEBUG] [sway/tree/arrange.c:296] Arranging workspace '1' at 0.000000, 25.000000
00:00:13.675 [DEBUG] [sway/tree/arrange.c:76] Arranging 0x7ffd04923220 horizontally
00:00:13.675 [DEBUG] [sway/tree/arrange.c:155] Arranging 0x7ffd04923160 vertically
00:00:13.675 [DEBUG] [sway/tree/arrange.c:155] Arranging 0x7ffd04923160 vertically
00:00:13.675 [DEBUG] [sway/ipc-server.c:326] Sending window::move event
00:00:13.675 [DEBUG] [sway/desktop/transaction.c:798] Transaction 0x5eae12cd6370 committing with 6 instructions
00:00:13.690 [DEBUG] [sway/desktop/transaction.c:884] Transaction 0x5eae12cd6370 is ready
00:00:13.691 [DEBUG] [sway/desktop/transaction.c:694] Applying transaction 0x5eae12cd6370
00:00:16.299 [DEBUG] [sway/commands/bind.c:618] running command for binding: focus parent
00:00:16.299 [INFO] [sway/commands.c:261] Handling command 'focus parent'
00:00:16.299 [DEBUG] [sway/desktop/transaction.c:798] Transaction 0x5eae129b6ef0 committing with 4 instructions
00:00:16.299 [DEBUG] [sway/desktop/transaction.c:694] Applying transaction 0x5eae129b6ef0
00:00:17.611 [DEBUG] [sway/commands/bind.c:618] running command for binding: move left
00:00:17.611 [INFO] [sway/commands.c:261] Handling command 'move left'
00:00:17.611 [DEBUG] [sway/commands/move.c:154] Reparenting container (perpendicular)
00:00:17.611 [DEBUG] [sway/commands/move.c:125] Promoting to sibling of cousin
00:00:17.611 [DEBUG] [sway/tree/arrange.c:262] Usable area for ws: 3840x2135@0,25
00:00:17.611 [DEBUG] [sway/tree/arrange.c:296] Arranging workspace '1' at 0.000000, 25.000000
00:00:17.611 [DEBUG] [sway/tree/arrange.c:76] Arranging 0x7ffd04923220 horizontally
00:00:17.611 [DEBUG] [sway/tree/arrange.c:155] Arranging 0x7ffd04923160 vertically
00:00:17.611 [DEBUG] [sway/tree/arrange.c:155] Arranging 0x7ffd049230a0 vertically
00:00:17.612 [DEBUG] [sway/desktop/transaction.c:798] Transaction 0x5eae12d4dc80 committing with 6 instructions
00:00:17.628 [DEBUG] [sway/desktop/transaction.c:884] Transaction 0x5eae12d4dc80 is ready
00:00:17.629 [DEBUG] [sway/desktop/transaction.c:694] Applying transaction 0x5eae12d4dc80

Configuration file:
default (/etc/sway/config)

Description:
swaymsg -m -t subscribe '["window"]' | jq -r 'select(.change == "move") | .change' reports move events when a single window is focused and move is used but does not do so when focus parent is used and then the parent container is moved.
The debug log describes the following sequence:

  1. focus a window and move it from one splitv container to another
  2. window::move is sent
  3. focus the parent of the window and move it to the other splitv container
  4. window::move is not sent

My usecase involves a daemon that monitors IPC window events to detect structural changes in the tree and I discovered that parent container movement appears not to emit such events.

@szczescie szczescie added the bug Not working as intended label Nov 16, 2024
@szczescie
Copy link
Author

szczescie commented Nov 17, 2024

In sway/command/move.c there are three ifs that check whether the container includes a view; they prevent move events from being sent. Removing these conditions seems to fix the issue and now moving parent containers using move <direction>, move container to workspace <num> and move container to mark <mark> correctly triggers IPC window move events.

if (container->view) {
	ipc_event_window(container, "move");
}

Edit:
I checked the commit history as well as the Sway IPC manpage and this seems to be intended behaviour. In that case, is making changes to this an option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

1 participant