labwc/include/layers.h
Johan Malm 9dbac2e06f layer: use scene-graph API more fully
...and thus simplify the usage of wlr_scene_node_at(). Specifically:

- desktop.c: in get_cursor_context() use node-description for
  layer-surfaces and layer-popups. This lays the foundations for a
  pointer-enter-event being sent when a new layer-surfaces appears under
  the pointer (even if the pointer doesn not move).

- layers.c:

  * Iterate over `struct wlr_scene_tree *layer_tree[]` rather than
    `struct wl_list layers[]` when arranging layers to avoid surfaces
    being out of sync with nodes

  * Set signal handlers after scene node creation to avoid configure
    race conditions

  * Handle scene-node destroy event rather than event of
    `struct wlr_layer_surface_v1`

  * Arrange layers on map and unmap

  * Handle client request for layer-change

Fixes issue #667
2022-12-29 23:18:08 +01:00

42 lines
991 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __LABWC_LAYERS_H
#define __LABWC_LAYERS_H
#include <wayland-server.h>
#include <wlr/types/wlr_layer_shell_v1.h>
struct server;
struct output;
struct lab_layer_surface {
struct wl_list link; /* output::layers */
struct wlr_scene_layer_surface_v1 *scene_layer_surface;
struct wl_listener node_destroy;
struct wl_listener map;
struct wl_listener unmap;
struct wl_listener surface_commit;
struct wl_listener output_destroy;
struct wl_listener new_popup;
struct wlr_box geo;
bool mapped;
/* TODO: add extent? */
struct server *server;
};
struct lab_layer_popup {
struct wlr_xdg_popup *wlr_popup;
struct wlr_scene_tree *scene_tree;
/* To simplify moving popup nodes from the bottom to the top layer */
struct wlr_box output_toplevel_sx_box;
struct wl_listener destroy;
struct wl_listener new_popup;
};
void layers_init(struct server *server);
void layers_arrange(struct output *output);
#endif /* __LABWC_LAYERS_H */