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

Tabbed layout doesn't change view instantly on mouse scroll #6034

Closed
David96 opened this issue Feb 16, 2021 · 4 comments
Closed

Tabbed layout doesn't change view instantly on mouse scroll #6034

David96 opened this issue Feb 16, 2021 · 4 comments
Labels
bug Not working as intended

Comments

@David96
Copy link
Contributor

David96 commented Feb 16, 2021

Please fill out the following:

  • Sway Version: latest master (commit a3d45c3)

  • Debug Log:
    sway-debug.txt
    I cut out the config parsing, the relevant part seems to be:

00:00:03.741 [DEBUG] [sway/commands/bind.c:617] running command for binding: layout tabbed
00:00:03.741 [INFO] [sway/commands.c:255] Handling command 'layout tabbed'
00:00:03.742 [DEBUG] [sway/tree/arrange.c:263] Usable area for ws: 1920x1055@0,25
00:00:03.742 [DEBUG] [sway/tree/arrange.c:293] Arranging workspace '1:>_' at 0.000000, 1105.000000
00:00:03.742 [DEBUG] [sway/tree/arrange.c:77] Arranging 0x7ffe230ad800 horizontally
00:00:03.742 [DEBUG] [sway/desktop/transaction.c:404] Transaction 0x563f9454d390 committing with 4 instructions
00:00:03.746 [DEBUG] [sway/desktop/transaction.c:500] Transaction 0x563f9454d390 is ready
00:00:03.746 [DEBUG] [sway/desktop/transaction.c:303] Applying transaction 0x563f9454d390
00:00:03.746 [DEBUG] [sway/tree/container.c:1194] Container 0x563f944169d0 entered output 0x563f94246750
00:00:03.800 [DEBUG] [sway/tree/view.c:491] Checking criteria [app_id=".*"]
00:00:03.800 [DEBUG] [sway/tree/view.c:493] Criteria already executed
00:00:03.802 [DEBUG] [sway/tree/view.c:491] Checking criteria [app_id=".*"]
00:00:03.803 [DEBUG] [sway/tree/view.c:493] Criteria already executed
00:00:05.102 [DEBUG] [sway/tree/arrange.c:263] Usable area for ws: 1920x1055@0,25
00:00:05.102 [DEBUG] [sway/tree/arrange.c:293] Arranging workspace '1:>_' at 0.000000, 1105.000000
00:00:05.102 [DEBUG] [sway/tree/arrange.c:77] Arranging 0x7ffe230ad8a0 horizontally
00:00:05.470 [DEBUG] [sway/desktop/transaction.c:404] Transaction 0x563f945afeb0 committing with 5 instructions
00:00:05.470 [DEBUG] [sway/desktop/transaction.c:303] Applying transaction 0x563f945afeb0
00:00:05.982 [DEBUG] [sway/tree/arrange.c:263] Usable area for ws: 1920x1055@0,25
00:00:05.982 [DEBUG] [sway/tree/arrange.c:293] Arranging workspace '1:>_' at 0.000000, 1105.000000
00:00:05.982 [DEBUG] [sway/tree/arrange.c:77] Arranging 0x7ffe230ad8a0 horizontally
00:00:06.326 [DEBUG] [sway/desktop/transaction.c:404] Transaction 0x563f945726a0 committing with 5 instructions
00:00:06.326 [DEBUG] [sway/desktop/transaction.c:303] Applying transaction 0x563f945726a0
00:00:06.798 [DEBUG] [sway/tree/arrange.c:263] Usable area for ws: 1920x1055@0,25
00:00:06.798 [DEBUG] [sway/tree/arrange.c:293] Arranging workspace '1:>_' at 0.000000, 1105.000000
00:00:06.798 [DEBUG] [sway/tree/arrange.c:77] Arranging 0x7ffe230ad8a0 horizontally
00:00:07.206 [DEBUG] [sway/desktop/transaction.c:404] Transaction 0x563f945afeb0 committing with 5 instructions
00:00:07.206 [DEBUG] [sway/desktop/transaction.c:303] Applying transaction 0x563f945afeb0
00:00:07.766 [DEBUG] [sway/tree/arrange.c:263] Usable area for ws: 1920x1055@0,25
00:00:07.766 [DEBUG] [sway/tree/arrange.c:293] Arranging workspace '1:>_' at 0.000000, 1105.000000
00:00:07.766 [DEBUG] [sway/tree/arrange.c:77] Arranging 0x7ffe230ad8a0 horizontally
00:00:08.054 [DEBUG] [sway/desktop/transaction.c:404] Transaction 0x563f94479800 committing with 5 instructions
00:00:08.054 [DEBUG] [sway/desktop/transaction.c:303] Applying transaction 0x563f94479800
  • Description:
    When using a tabbed layout, usually one is able to switch between windows by scrolling on the title bar. This still works, but the change only becomes visible when I move the mouse around (reliably when I move the mouse from the title of the old focused window to the titlebar of the window I want to focus). See the gif, note that the window change only takes effect as soon as the mouse moves on the other titlebar, the scrolling itself doesn't have a visible effect.
    sway-bug

When I have some time, I'll try to bisect the issue, possible candidates would be the transaction changes by @kennylevinsen as I only noticed this recently.

Edit: yep, this only happens after b5b628c - directly after this commit it's even worse, I have to actually click on the window for the change to become visible.

@David96 David96 added the bug Not working as intended label Feb 16, 2021
@kennylevinsen
Copy link
Member

Sounds right - transaction_commit was moved from being a "catch all" to explicitly at their use, but a few uses have been missed it would seem. Appreciate the report.

@David96
Copy link
Contributor Author

David96 commented Feb 16, 2021

So the right way of fixing this is simply adding a transaction_commit_dirty() after changing the focus? If so, I can create a pull request for that.

@kennylevinsen
Copy link
Member

If you look in seatop_default.c, for places where seat_set_focus* is called (which, surprise surprise, changes focus), there should be a transaction_commit_dirty afterwards.

seatop_begin_* does a transaction_commit_dirty itself, so if that follows then there is no need. Maybe a comment in those cases that they're not needed could add clarity.

(The reason seat_set_focus doesn't itself commit is that it is used from sway commands, which should preferably be bunched together in a single commit if you e.g. move, resize and focus a window in one go.)

David96 added a commit to David96/sway that referenced this issue Feb 16, 2021
Every seat_set_focus* should be followed by a transaction_commit_dirty.
In cases where the focus change is followed by a seatop_begin* this is
not needed, as transaction_commit_dirty is then called by the
seatop_begin* function.

Fixes swaywm#6034
@David96
Copy link
Contributor Author

David96 commented Feb 16, 2021

Alright, thanks for the clarification. Found a bunch of other seat_set_focus calls without the transaction_commit_dirty. See #6035.

David96 added a commit to David96/sway that referenced this issue Feb 16, 2021
Every seat_set_focus* should be followed by a transaction_commit_dirty.
In cases where the focus change is followed by a seatop_begin* this is
not needed, as transaction_commit_dirty is then called by the
seatop_begin* function.

Fixes swaywm#6034
@Xyene Xyene closed this as completed in 28cadf5 Feb 16, 2021
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

2 participants