mirror of
https://github.com/swaywm/sway.git
synced 2024-12-27 23:47:21 +01:00
Fix right-click/popups and add state checks
This commit is contained in:
parent
2dceae6224
commit
1893515d3a
1 changed files with 5 additions and 3 deletions
|
@ -657,7 +657,8 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
|
|||
}
|
||||
|
||||
// Handle tiling resize via border
|
||||
if (resize_edge && button == BTN_LEFT && !is_floating) {
|
||||
if (resize_edge && button == BTN_LEFT && state == WLR_BUTTON_PRESSED &&
|
||||
!is_floating) {
|
||||
seat_set_focus(seat, cont);
|
||||
seat_begin_resize_tiling(seat, cont, button, edge);
|
||||
return;
|
||||
|
@ -666,7 +667,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
|
|||
// Handle tiling resize via mod
|
||||
bool mod_pressed = keyboard &&
|
||||
(wlr_keyboard_get_modifiers(keyboard) & config->floating_mod);
|
||||
if (!is_floating) {
|
||||
if (!is_floating && mod_pressed && state == WLR_BUTTON_PRESSED) {
|
||||
uint32_t btn_resize = config->floating_mod_inverse ?
|
||||
BTN_LEFT : BTN_RIGHT;
|
||||
if (button == btn_resize) {
|
||||
|
@ -682,7 +683,8 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
|
|||
}
|
||||
|
||||
// Handle beginning floating move
|
||||
if (is_floating_or_child && !is_fullscreen_or_child) {
|
||||
if (is_floating_or_child && !is_fullscreen_or_child &&
|
||||
state == WLR_BUTTON_PRESSED) {
|
||||
uint32_t btn_move = config->floating_mod_inverse ? BTN_RIGHT : BTN_LEFT;
|
||||
if (button == btn_move && state == WLR_BUTTON_PRESSED &&
|
||||
(mod_pressed || on_titlebar)) {
|
||||
|
|
Loading…
Reference in a new issue