mirror of
https://github.com/labwc/labwc.git
synced 2025-10-31 22:25:34 -04:00
xwayland: Add mapped argument to xwayland_view_create()
This is a trivial cleanup to make xwayland_view_create() symmetrical with xwayland_unmanaged_create(), and avoid the need to access view->impl from xwayland-unmanaged.c. The return value of xwayland_view_create() is no longer user, so return void. No functional change.
This commit is contained in:
parent
9a9e20d2b0
commit
5b962d5437
3 changed files with 12 additions and 14 deletions
|
|
@ -43,8 +43,8 @@ struct xwayland_view {
|
||||||
void xwayland_unmanaged_create(struct server *server,
|
void xwayland_unmanaged_create(struct server *server,
|
||||||
struct wlr_xwayland_surface *xsurface, bool mapped);
|
struct wlr_xwayland_surface *xsurface, bool mapped);
|
||||||
|
|
||||||
struct xwayland_view *xwayland_view_create(struct server *server,
|
void xwayland_view_create(struct server *server,
|
||||||
struct wlr_xwayland_surface *xsurface);
|
struct wlr_xwayland_surface *xsurface, bool mapped);
|
||||||
|
|
||||||
struct wlr_xwayland_surface *xwayland_surface_from_view(struct view *view);
|
struct wlr_xwayland_surface *xwayland_surface_from_view(struct view *view);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -146,13 +146,7 @@ unmanaged_handle_override_redirect(struct wl_listener *listener, void *data)
|
||||||
unmanaged_handle_destroy(&unmanaged->destroy, NULL);
|
unmanaged_handle_destroy(&unmanaged->destroy, NULL);
|
||||||
xsurface->data = NULL;
|
xsurface->data = NULL;
|
||||||
|
|
||||||
struct xwayland_view *xwayland_view = xwayland_view_create(server, xsurface);
|
xwayland_view_create(server, xsurface, mapped);
|
||||||
if (mapped) {
|
|
||||||
struct view *view = &xwayland_view->base;
|
|
||||||
if (view->impl->map) {
|
|
||||||
view->impl->map(view);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -608,8 +608,9 @@ static const struct view_impl xwayland_view_impl = {
|
||||||
.move_to_back = xwayland_view_move_to_back,
|
.move_to_back = xwayland_view_move_to_back,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct xwayland_view *
|
void
|
||||||
xwayland_view_create(struct server *server, struct wlr_xwayland_surface *xsurface)
|
xwayland_view_create(struct server *server,
|
||||||
|
struct wlr_xwayland_surface *xsurface, bool mapped)
|
||||||
{
|
{
|
||||||
struct xwayland_view *xwayland_view = znew(*xwayland_view);
|
struct xwayland_view *xwayland_view = znew(*xwayland_view);
|
||||||
struct view *view = &xwayland_view->base;
|
struct view *view = &xwayland_view->base;
|
||||||
|
|
@ -669,7 +670,10 @@ xwayland_view_create(struct server *server, struct wlr_xwayland_surface *xsurfac
|
||||||
wl_signal_add(&xsurface->events.set_override_redirect, &xwayland_view->override_redirect);
|
wl_signal_add(&xsurface->events.set_override_redirect, &xwayland_view->override_redirect);
|
||||||
|
|
||||||
wl_list_insert(&view->server->views, &view->link);
|
wl_list_insert(&view->server->views, &view->link);
|
||||||
return xwayland_view;
|
|
||||||
|
if (mapped) {
|
||||||
|
xwayland_view_map(view);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -686,9 +690,9 @@ handle_new_surface(struct wl_listener *listener, void *data)
|
||||||
*/
|
*/
|
||||||
if (xsurface->override_redirect) {
|
if (xsurface->override_redirect) {
|
||||||
xwayland_unmanaged_create(server, xsurface, /* mapped */ false);
|
xwayland_unmanaged_create(server, xsurface, /* mapped */ false);
|
||||||
return;
|
} else {
|
||||||
|
xwayland_view_create(server, xsurface, /* mapped */ false);
|
||||||
}
|
}
|
||||||
xwayland_view_create(server, xsurface);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue