mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
view: honor automatic placement when adjusting floating geometry
The view_adjust_floating_geometry function is called when un-maximizing a window or changing the output layout to ensure that views are well placed. Rather than always centering these views should they fall offscren, use the automatic placement strategy if so configured.
This commit is contained in:
parent
7f357a388b
commit
b1c5e95c05
4 changed files with 32 additions and 19 deletions
|
|
@ -945,9 +945,9 @@ actions_run(struct view *activator, struct server *server,
|
|||
break;
|
||||
case ACTION_TYPE_AUTO_PLACE:
|
||||
if (view) {
|
||||
int x = 0, y = 0;
|
||||
if (placement_find_best(view, &x, &y)) {
|
||||
view_move(view, x, y);
|
||||
struct wlr_box geometry = view->pending;
|
||||
if (placement_find_best(view, &geometry)) {
|
||||
view_move(view, geometry.x, geometry.y);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue