mirror of
https://github.com/labwc/labwc.git
synced 2025-11-01 22:58:47 -04:00
Add resistance when dragging tiled windows
Adds a config option <snapping><dragResistance> with default value 20. This prevents tiled/maximized windows from being unintentionally untiled.
This commit is contained in:
parent
750d37b16c
commit
c202d77c2d
8 changed files with 82 additions and 4 deletions
|
|
@ -232,9 +232,19 @@ request_set_primary_selection_notify(struct wl_listener *listener, void *data)
|
|||
static void
|
||||
process_cursor_move(struct server *server, uint32_t time)
|
||||
{
|
||||
struct view *view = server->grabbed_view;
|
||||
|
||||
/*
|
||||
* Un-tile the view when interactive move is delayed and the distance
|
||||
* of cursor movement exceeds <snapping><dragResistance>.
|
||||
*/
|
||||
if (server->move_pending && !interactive_move_tiled_view_to(
|
||||
server, server->grabbed_view, &server->grab_box)) {
|
||||
return;
|
||||
}
|
||||
|
||||
double dx = server->seat.cursor->x - server->grab_x;
|
||||
double dy = server->seat.cursor->y - server->grab_y;
|
||||
struct view *view = server->grabbed_view;
|
||||
|
||||
/* Move the grabbed view to the new position. */
|
||||
dx += server->grab_box.x;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue