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

for_window resize fails on container moved to scratchpad without scratchpad show #8493

Open
sahinf opened this issue Dec 8, 2024 · 1 comment
Labels
bug Not working as intended

Comments

@sahinf
Copy link
Contributor

sahinf commented Dec 8, 2024

  1. I followed man sway(5) for_window to resize a container and move it to scratchpad.
exec $term --app-id "float"
for_window [app_id="float"] floating yes, resize set width 1600

exec $term --app-id "scratch"
for_window [app_id="scratch"] resize set width 1600, move scratchpad
  1. I ran scratchpad show

Then I saw that the size of the scratchpad terminal was not applied.

I added a scratchpad_show in the for_window like

exec $term --app-id "scratch"
for_window [app_id="scratch"] resize set width 1600, move scratchpad, scratchpad show

which resized the container as I wanted. However, I don't want that container visible from the start so it's not really a fix for me.

I added a breakpoint right before returning in resize_set_floating and saw both the container->current and container->pending width/height values are set to the expected values in both instances. I also broke on xdg_shell:handle_commit and it looks like the the correct view->container->current width/height values do not propagate to the view->geometry.

@sahinf sahinf added the bug Not working as intended label Dec 8, 2024
@sahinf
Copy link
Contributor Author

sahinf commented Dec 9, 2024

I added some additional debug logs

00:00:00.183 [sway/commands.c:261] Handling command 'resize set width 200 height 400'
00:00:00.183 [sway/tree/arrange.c:249] arrange_container() 'SCRATCHING' YES view (57534) calling view_autoconfigure()
00:00:00.183 [sway/tree/view.c:259] view_autoconfigure() on '0�q��U' '' 'SCRATCHING'
00:00:00.183 [sway/tree/view.c:382] Container successfully reached end of view_autoconfigure()
00:00:00.183 [sway/tree/view.c:383] x=[1180.000000], y=[531.375000], width=[196.000000], height=[373.000000]
00:00:00.183 [sway/commands/resize.c:418] resize_set_floating() pending width=196.000000, height=373.000000 and con->node->dirty bit=true
00:00:00.183 [sway/desktop/transaction.c:199] Adding instruction 0 (0x7ffd9f267b60) content_width=0.000000, content_height=0.000000
00:00:00.183 [sway/desktop/transaction.c:199] Adding instruction 0 (0x7ffd9f267b60) content_width=0.000000, content_height=0.000000
00:00:00.183 [sway/desktop/transaction.c:146] copy_container_state setting state := container->pending for 'SCRATCHING'
                                                                0.000000 := 196.000000
                                                                0.000000 := 373.000000
00:00:00.183 [sway/desktop/transaction.c:199] Adding instruction 0 (0x7ffd9f267b60) content_width=0.000000, content_height=0.000000
00:00:00.183 [sway/desktop/transaction.c:146] copy_container_state setting state := container->pending for 'FLOATING'
                                                                0.000000 := 195.000000
                                                                0.000000 := 364.000000
00:00:00.183 [sway/desktop/transaction.c:816] Transaction 0x55b2b1793150 committing with 3 instructions
00:00:00.183 [wlr] [types/scene/wlr_scene.c:1138] wlr_scene_node_set_enabled( node=0x55b2b1718e80, enabled=(null) )
00:00:00.183 [wlr] [types/scene/wlr_scene.c:1138] wlr_scene_node_set_enabled( node=0x55b2b1715400, enabled=(null) )
00:00:00.183 [wlr] [types/scene/wlr_scene.c:1138] wlr_scene_node_set_enabled( node=0x55b2b1718e80, enabled=true )
00:00:00.183 [sway/desktop/transaction.c:712] Applying transaction 0x55b2b1793150
00:00:00.183 [wlr] [types/scene/wlr_scene.c:1138] wlr_scene_node_set_enabled( node=0x55b2b18290e0, enabled=(null) )
00:00:00.183 [wlr] [types/scene/wlr_scene.c:1138] wlr_scene_node_set_enabled( node=0x55b2b1718e80, enabled=(null) )
00:00:00.183 [wlr] [types/scene/wlr_scene.c:1138] wlr_scene_node_set_enabled( node=0x55b2b182a410, enabled=(null) )
00:00:00.183 [wlr] [types/scene/wlr_scene.c:1138] wlr_scene_node_set_enabled( node=0x55b2b1715400, enabled=true )
00:00:00.183 [wlr] [types/scene/wlr_scene.c:1138] wlr_scene_node_set_enabled( node=0x55b2b1717920, enabled=(null) )
00:00:00.183 [sway/desktop/transaction.c:402] arrange_container VIEW [57532] 'P�q��U' 'FLOATING'
00:00:00.183 [sway/desktop/transaction.c:300] arrange_children() of cont 'NULL'
00:00:00.183 [wlr] [types/scene/wlr_scene.c:1138] wlr_scene_node_set_enabled( node=0x55b2b1716de0, enabled=true )
00:00:00.183 [sway/desktop/transaction.c:199] Adding instruction 0 (0x7ffd9f267bc0) content_width=0.000000, content_height=0.000000
00:00:00.183 [sway/desktop/transaction.c:146] copy_container_state setting state := container->pending for 'SCRATCHING'
                                                                0.000000 := 689.000000
                                                                0.000000 := 494.000000
00:00:00.183 [sway/desktop/transaction.c:816] Transaction 0x55b2b1793150 committing with 1 instructions

and it seems like the correct values do get written to the scratchpad ("SCRATCHING") container, but then they get overwritten by the default/natural xdg_toplevel geometry values. I would appreciate any feedback to help tackle this.

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