mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
interactive: allow moving horizontally/vertically maximized window
Applies drag resistance unidirectionally for horizontally/vertically maximized windows, allowing them to be dragged without being untiled immediately. When the distance of cursor movement orthogonal to the maximized direction exceeds <resistance><unMaximizeThreshold>. While dragging a horizontally/vertically maximized window, edge/region snapping is disabled to prevent unintentional snapping and overlays. This commit also includes some refactoring to simplify the logic.
This commit is contained in:
parent
2e19bd4d5b
commit
1f1bdad087
11 changed files with 137 additions and 120 deletions
10
src/xdg.c
10
src/xdg.c
|
|
@ -93,14 +93,8 @@ do_late_positioning(struct view *view)
|
|||
struct server *server = view->server;
|
||||
if (server->input_mode == LAB_INPUT_STATE_MOVE
|
||||
&& view == server->grabbed_view) {
|
||||
/* Anchor view to original grab position */
|
||||
interactive_anchor_to_cursor(view, &view->pending,
|
||||
server->grab_x, server->grab_y);
|
||||
/* Next update grab offsets */
|
||||
server->grab_box = view->pending;
|
||||
/* Finally, move by same distance cursor has moved */
|
||||
view->pending.x += server->seat.cursor->x - server->grab_x;
|
||||
view->pending.y += server->seat.cursor->y - server->grab_y;
|
||||
/* Reposition the view while anchoring it to cursor */
|
||||
interactive_anchor_to_cursor(server, &view->pending);
|
||||
} else {
|
||||
/* TODO: smart placement? */
|
||||
view_compute_centered_position(view, NULL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue