mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
view: Add optional output parameter to view_center()
Allows centering the view on a specific output without the workaround of overwriting view->current.x/y.
This commit is contained in:
parent
df7c47b8d7
commit
5062c5bea3
6 changed files with 22 additions and 30 deletions
|
|
@ -278,11 +278,7 @@ position_xdg_toplevel_view(struct view *view)
|
|||
xdg_toplevel_from_view(view)->parent;
|
||||
|
||||
if (!parent_xdg_toplevel) {
|
||||
struct wlr_box box =
|
||||
output_usable_area_from_cursor_coords(view->server);
|
||||
view->current.x = box.x;
|
||||
view->current.y = box.y;
|
||||
view_center(view);
|
||||
view_center(view, output_from_cursor_coords(view->server));
|
||||
} else {
|
||||
/*
|
||||
* If child-toplevel-views, we center-align relative to their
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue