mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-25 21:58:31 +01:00
09c360d503
We tried to synchronize layer shell popups with the parent layer shell on commits, but this is subtly wrong because we would only update the position for one layer shell that was committed, but not any other layer that might be affected. By moving handling to the scene descriptor we can iterate all popups and ensure they are synchronized.
44 lines
1,022 B
C
44 lines
1,022 B
C
#ifndef _SWAY_LAYERS_H
|
|
#define _SWAY_LAYERS_H
|
|
#include <stdbool.h>
|
|
#include <wlr/types/wlr_compositor.h>
|
|
#include <wlr/types/wlr_layer_shell_v1.h>
|
|
#include "sway/tree/view.h"
|
|
|
|
struct sway_layer_surface {
|
|
struct wl_listener map;
|
|
struct wl_listener unmap;
|
|
struct wl_listener surface_commit;
|
|
struct wl_listener output_destroy;
|
|
struct wl_listener node_destroy;
|
|
struct wl_listener new_popup;
|
|
|
|
bool mapped;
|
|
|
|
struct wlr_scene_tree *popups;
|
|
struct sway_popup_desc desc;
|
|
|
|
struct sway_output *output;
|
|
struct wlr_scene_layer_surface_v1 *scene;
|
|
struct wlr_scene_tree *tree;
|
|
struct wlr_layer_surface_v1 *layer_surface;
|
|
};
|
|
|
|
struct sway_layer_popup {
|
|
struct wlr_xdg_popup *wlr_popup;
|
|
struct wlr_scene_tree *scene;
|
|
struct sway_layer_surface *toplevel;
|
|
|
|
struct wl_listener destroy;
|
|
struct wl_listener new_popup;
|
|
struct wl_listener commit;
|
|
};
|
|
|
|
struct sway_output;
|
|
|
|
struct wlr_layer_surface_v1 *toplevel_layer_surface_from_surface(
|
|
struct wlr_surface *surface);
|
|
|
|
void arrange_layers(struct sway_output *output);
|
|
|
|
#endif
|