static void show_one_xwl_view(struct view *view)
{
fprintf(stderr, "XWL ");
- if (!view->been_mapped) {
- fprintf(stderr, "- ");
- } else {
- fprintf(stderr, "%d ", xwl_nr_parents(view));
- }
+ fprintf(stderr, "%d ", xwl_nr_parents(view));
fprintf(stderr, " %d ",
wl_list_length(&view->xwayland_surface->children));
if (view->mapped) {
* Other variables to consider printing:
*
* view->mapped,
- * view->been_mapped,
* view->xwayland_surface->override_redirect,
* wlr_xwayland_or_surface_wants_focus(view->xwayland_surface));
* view->xwayland_surface->saved_width,
struct wlr_box box = { .x = 0, .y = 0, .width = 0, .height = 0 };
BUG_ON(!view);
- BUG_ON(!view->surface);
- if (!view || !view->surface)
- return box;
- BUG_ON(!view->been_mapped);
- BUG_ON(!view->show_server_side_deco);
if ((view->w < 1) || (view->h < 1)) {
warn("view (%p) has no width/height", view);
return box;
static bool is_toplevel(struct view *view)
{
- if (!view || !view->been_mapped)
+ if (!view)
return false;
switch (view->type) {
case LAB_XDG_SHELL_VIEW:
static void move_xwayland_decendants_to_front(struct view *parent)
{
- if (parent->type != LAB_XWAYLAND_VIEW)
- return;
- if (!parent || !parent->been_mapped)
+ if (!parent || parent->type != LAB_XWAYLAND_VIEW)
return;
struct view *view, *next;
wl_list_for_each_reverse_safe(view, next, &parent->server->views, link)
break;
if (view->type != LAB_XWAYLAND_VIEW)
continue;
- if (!view->been_mapped || !view->mapped)
+ if (!view->mapped)
continue;
if (top_parent(view) != parent->xwayland_surface)
continue;
*/
struct view *view;
wl_list_for_each (view, &server->views, link) {
- if (!view->been_mapped)
- continue;
if (_view_at(view, lx, ly, surface, sx, sy))
return view;
if (!view->show_server_side_deco)
if (!view->been_mapped) {
view->show_server_side_deco = has_ssd(view);
view_init_position(view);
+ wl_list_insert(&view->server->views, &view->link);
}
view->been_mapped = true;
void xwl_surface_destroy(struct wl_listener *listener, void *data)
{
struct view *view = wl_container_of(listener, view, destroy);
- wl_list_remove(&view->link);
+ if (view->been_mapped)
+ wl_list_remove(&view->link);
wl_list_remove(&view->map.link);
wl_list_remove(&view->unmap.link);
wl_list_remove(&view->destroy.link);
view->request_configure.notify = xwl_surface_configure;
wl_signal_add(&xwayland_surface->events.request_configure,
&view->request_configure);
-
- wl_list_insert(&server->views, &view->link);
}