Skip to content

Commit

Permalink
input/seatop_default: release on empty workspace
Browse files Browse the repository at this point in the history
Instead of handling presses and releases on empty workspaces as setting
focus to the workspace, handle releases by notifying the seat of a
pointer action. This way DnDs are correctly released if the button is
released over an empty workspace.

Fixes swaywm#3932
  • Loading branch information
Emantor committed Apr 10, 2020
1 parent 854497b commit cbfe70a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sway/input/seatop_default.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,12 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
}

// Handle clicking an empty workspace
if (node && node->type == N_WORKSPACE) {
seat_set_focus(seat, node);
if (node && node->type == N_WORKSPACE ) {
if ( state == WLR_BUTTON_PRESSED) {
seat_set_focus(seat, node);
} else {
seat_pointer_notify_button(seat, time_msec, button, state);
}
return;
}

Expand Down

0 comments on commit cbfe70a

Please sign in to comment.