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

Freeze when scrolling fast between workspaces #892

Closed
maximiliankaul opened this issue Sep 10, 2016 · 7 comments · Fixed by #1313
Closed

Freeze when scrolling fast between workspaces #892

maximiliankaul opened this issue Sep 10, 2016 · 7 comments · Fixed by #1313

Comments

@maximiliankaul
Copy link

Sway freezes when I open multiple workspaces and then use the mousewheel in the bar to switch between them very quickly.
Setting wrap_scroll does not make a difference.
I can not reproduce the issue when switching via bash like this (so I assume it's not the speed but something with the mousewheel):

for i in `seq 1 1000`; do
  swaymsg workspace prev_on_output
  swaymsg workspace next_on_output
done

The only options I have when the freeze happens is to hibernate the laptop using the power key (which does not help because it's still frozen when resuming) and to reboot.

Do you need additional information?

Versions (all Arch Linux packages):
sway version: 0.9-1:
wlc: 0.0.5-1
wayland: 1.11.0-1
sway.log.txt
Thanks for a awesome project :)

@kamiyaa
Copy link

kamiyaa commented Nov 29, 2016

I seem to be having similar freezes. Though, mine are not from scrolling between workspaces, but just switching between them using mod+num rapidly.

@jarias
Copy link

jarias commented Mar 31, 2017

Having the same issue here let me know what information I can provide to help fix this.

@ddevault
Copy link
Contributor

Having the same issue here let me know what information I can provide to help fix this.

The output of git diff on a branch with the feature patched would be a great start

@kamiyaa
Copy link

kamiyaa commented Apr 2, 2017

just wondering if it's possible to have the scrolling between work spaces feature something that can be toggled during compile time. :x

@ilyaluk-old
Copy link
Contributor

I've debugged this issue. That's IPC problem. When user scrolls or clicks in swaybar, ipc_send_workspace_command is being called, which calls ipc_single_command, which waits for a reply and blocks swaybar thread until response from socket. But the response to this command not being sent by IPC server until all subscriptions processed. swaybar opens second socket for event processing and subscribes to workspace updates.

Looks like when user scrolling too fast, buffer of event socket fills, which causes deadlock (sway cannot write to event socket because buffer is full, therefore cannot send response, and swaybar infinitely waits for this response).

I'm not sure what is the best architectural solution.

@ddevault
Copy link
Contributor

Probably best to change swaybar to avoid submitting so many IPC requests in a row.

@ddevault
Copy link
Contributor

And update sway to avoid the deadlock

ilyaluk-old pushed a commit to ilyaluk-old/sway that referenced this issue Aug 4, 2017
Removed additional event socket to reduce synchronisation problems
and limited workspace update requests count.
@ddevault ddevault mentioned this issue Oct 7, 2017
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

5 participants