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

Fix move next crash #1130

Merged
merged 2 commits into from
Mar 19, 2017
Merged

Fix move next crash #1130

merged 2 commits into from
Mar 19, 2017

Conversation

oranenj
Copy link
Contributor

@oranenj oranenj commented Mar 19, 2017

This pull request fixes #1120 for me.

The commit message contains an explanation of why I think it works.

It also includes a small behaviour change to workspace layouts, as I found it confusing that they would default to L_HORIZ despite the default of an output being something else. Perhaps there's a reason for this that I'm not seeing?

Hardcoding it to L_HORIZ does not make sense to me,
as you get the unexpected behaviour that windows will be
arranged horizontally until you switch the layout.
Fixes swaywm#1120

When the parent of a view is C_WORKSPACE and the movement direction
is either MOVE_PREV or MOVE_NEXT, the code would attempt to move the
views to the next output, but swayc_adjacent_output can't accept
non-directional movement commands and causes undefined behaviour and
a segfault.

If the code is simply skipped, we end up in an infinite loop.

Instead, we can allow containers whose parent is a C_WORKSPACE take the
path that handles MOVE_PREV and MOVE_NEXT, which behaves as you would
expect.

I'm not certain that this fix is entirely correct as the desired behaviour
of move_container is not very well defined, but it seems to work.
@ddevault ddevault merged commit e659db4 into swaywm:master Mar 19, 2017
@ddevault
Copy link
Contributor

Thanks!

ddevault added a commit that referenced this pull request Apr 3, 2017
@ddevault ddevault mentioned this pull request Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

"move next" crashes sway
2 participants