mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-31 22:25:27 -04:00
Port 0.16 wlr_output_layout_get_box changes
Fixes memory leaks.
This commit is contained in:
parent
5818a32a99
commit
979ff58a24
3 changed files with 17 additions and 13 deletions
5
cage.c
5
cage.c
|
|
@ -536,8 +536,9 @@ main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Place the cursor in the center of the output layout. */
|
/* Place the cursor in the center of the output layout. */
|
||||||
struct wlr_box *layout_box = wlr_output_layout_get_box(server.output_layout, NULL);
|
struct wlr_box layout_box;
|
||||||
wlr_cursor_warp(server.seat->cursor, NULL, layout_box->width / 2, layout_box->height / 2);
|
wlr_output_layout_get_box(server.output_layout, NULL, &layout_box);
|
||||||
|
wlr_cursor_warp(server.seat->cursor, NULL, layout_box.width / 2, layout_box.height / 2);
|
||||||
|
|
||||||
wl_display_run(server.wl_display);
|
wl_display_run(server.wl_display);
|
||||||
|
|
||||||
|
|
|
||||||
9
view.c
9
view.c
|
|
@ -88,12 +88,13 @@ view_center(struct cg_view *view, struct wlr_box *layout_box)
|
||||||
void
|
void
|
||||||
view_position(struct cg_view *view)
|
view_position(struct cg_view *view)
|
||||||
{
|
{
|
||||||
struct wlr_box *layout_box = wlr_output_layout_get_box(view->server->output_layout, NULL);
|
struct wlr_box layout_box;
|
||||||
|
wlr_output_layout_get_box(view->server->output_layout, NULL, &layout_box);
|
||||||
|
|
||||||
if (view_is_primary(view) || view_extends_output_layout(view, layout_box)) {
|
if (view_is_primary(view) || view_extends_output_layout(view, &layout_box)) {
|
||||||
view_maximize(view, layout_box);
|
view_maximize(view, &layout_box);
|
||||||
} else {
|
} else {
|
||||||
view_center(view, layout_box);
|
view_center(view, &layout_box);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
16
xdg_shell.c
16
xdg_shell.c
|
|
@ -72,13 +72,14 @@ popup_unconstrain(struct cg_view *view, struct wlr_xdg_popup *popup)
|
||||||
struct wlr_output_layout *output_layout = server->output_layout;
|
struct wlr_output_layout *output_layout = server->output_layout;
|
||||||
struct wlr_output *wlr_output =
|
struct wlr_output *wlr_output =
|
||||||
wlr_output_layout_output_at(output_layout, view->lx + popup_box->x, view->ly + popup_box->y);
|
wlr_output_layout_output_at(output_layout, view->lx + popup_box->x, view->ly + popup_box->y);
|
||||||
struct wlr_box *output_box = wlr_output_layout_get_box(output_layout, wlr_output);
|
struct wlr_box output_box;
|
||||||
|
wlr_output_layout_get_box(output_layout, wlr_output, &output_box);
|
||||||
|
|
||||||
struct wlr_box output_toplevel_box = {
|
struct wlr_box output_toplevel_box = {
|
||||||
.x = output_box->x - view->lx,
|
.x = output_box.x - view->lx,
|
||||||
.y = output_box->y - view->ly,
|
.y = output_box.y - view->ly,
|
||||||
.width = output_box->width,
|
.width = output_box.width,
|
||||||
.height = output_box->height,
|
.height = output_box.height,
|
||||||
};
|
};
|
||||||
|
|
||||||
wlr_xdg_popup_unconstrain_from_box(popup, &output_toplevel_box);
|
wlr_xdg_popup_unconstrain_from_box(popup, &output_toplevel_box);
|
||||||
|
|
@ -166,8 +167,9 @@ handle_xdg_shell_surface_request_fullscreen(struct wl_listener *listener, void *
|
||||||
* Certain clients do not like figuring out their own window geometry if they
|
* Certain clients do not like figuring out their own window geometry if they
|
||||||
* display in fullscreen mode, so we set it here.
|
* display in fullscreen mode, so we set it here.
|
||||||
*/
|
*/
|
||||||
struct wlr_box *layout_box = wlr_output_layout_get_box(xdg_shell_view->view.server->output_layout, NULL);
|
struct wlr_box layout_box;
|
||||||
wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_toplevel, layout_box->width, layout_box->height);
|
wlr_output_layout_get_box(xdg_shell_view->view.server->output_layout, NULL, &layout_box);
|
||||||
|
wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_toplevel, layout_box.width, layout_box.height);
|
||||||
|
|
||||||
wlr_xdg_toplevel_set_fullscreen(xdg_shell_view->xdg_toplevel,
|
wlr_xdg_toplevel_set_fullscreen(xdg_shell_view->xdg_toplevel,
|
||||||
xdg_shell_view->xdg_toplevel->requested.fullscreen);
|
xdg_shell_view->xdg_toplevel->requested.fullscreen);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue