mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
view: Use wlr_box for current/pending geometry
This commit is contained in:
parent
3941991505
commit
b75dbd5b38
15 changed files with 169 additions and 186 deletions
|
|
@ -26,12 +26,7 @@ interactive_begin(struct view *view, enum input_mode mode, uint32_t edges)
|
|||
*/
|
||||
struct server *server = view->server;
|
||||
struct seat *seat = &server->seat;
|
||||
struct wlr_box geometry = {
|
||||
.x = view->x,
|
||||
.y = view->y,
|
||||
.width = view->w,
|
||||
.height = view->h
|
||||
};
|
||||
struct wlr_box geometry = view->current;
|
||||
|
||||
switch (mode) {
|
||||
case LAB_INPUT_STATE_MOVE:
|
||||
|
|
@ -52,10 +47,12 @@ interactive_begin(struct view *view, enum input_mode mode, uint32_t edges)
|
|||
* to keep it (in the snap-to-maximize case).
|
||||
*/
|
||||
geometry = view->natural_geometry;
|
||||
geometry.x = max_move_scale(seat->cursor->x, view->x,
|
||||
view->w, geometry.width);
|
||||
geometry.y = max_move_scale(seat->cursor->y, view->y,
|
||||
view->h, geometry.height);
|
||||
geometry.x = max_move_scale(seat->cursor->x,
|
||||
view->current.x, view->current.width,
|
||||
geometry.width);
|
||||
geometry.y = max_move_scale(seat->cursor->y,
|
||||
view->current.y, view->current.height,
|
||||
geometry.height);
|
||||
view_restore_to(view, geometry);
|
||||
} else {
|
||||
/* Store natural geometry at start of move */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue