mirror of
https://github.com/NickHu/sway
synced 2024-12-30 22:23:30 +01:00
handlers: Pass workspace to workspace_switch, not output.
This commit is contained in:
parent
6cd106d23c
commit
fabcf7c678
1 changed files with 4 additions and 4 deletions
|
@ -369,25 +369,25 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct
|
||||||
swayc_t *output = swayc_active_output(), *adjacent = NULL;
|
swayc_t *output = swayc_active_output(), *adjacent = NULL;
|
||||||
if (origin->x == 0) { // Left edge
|
if (origin->x == 0) { // Left edge
|
||||||
if ((adjacent = swayc_adjacent_output(output, MOVE_LEFT))) {
|
if ((adjacent = swayc_adjacent_output(output, MOVE_LEFT))) {
|
||||||
if (workspace_switch(adjacent)) {
|
if (workspace_switch(swayc_active_workspace_for(adjacent))) {
|
||||||
new_origin.x = adjacent->width;
|
new_origin.x = adjacent->width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ((double)origin->x == output->width) { // Right edge
|
} else if ((double)origin->x == output->width) { // Right edge
|
||||||
if ((adjacent = swayc_adjacent_output(output, MOVE_RIGHT))) {
|
if ((adjacent = swayc_adjacent_output(output, MOVE_RIGHT))) {
|
||||||
if (workspace_switch(adjacent)) {
|
if (workspace_switch(swayc_active_workspace_for(adjacent))) {
|
||||||
new_origin.x = 0;
|
new_origin.x = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (origin->y == 0) { // Top edge
|
} else if (origin->y == 0) { // Top edge
|
||||||
if ((adjacent = swayc_adjacent_output(output, MOVE_UP))) {
|
if ((adjacent = swayc_adjacent_output(output, MOVE_UP))) {
|
||||||
if (workspace_switch(adjacent)) {
|
if (workspace_switch(swayc_active_workspace_for(adjacent))) {
|
||||||
new_origin.y = adjacent->height;
|
new_origin.y = adjacent->height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ((double)origin->y == output->height) { // Bottom edge
|
} else if ((double)origin->y == output->height) { // Bottom edge
|
||||||
if ((adjacent = swayc_adjacent_output(output, MOVE_DOWN))) {
|
if ((adjacent = swayc_adjacent_output(output, MOVE_DOWN))) {
|
||||||
if (workspace_switch(adjacent)) {
|
if (workspace_switch(swayc_active_workspace_for(adjacent))) {
|
||||||
new_origin.y = 0;
|
new_origin.y = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue