xdg-popup: add proper configure flow

This commit is contained in:
Kirill Primak 2022-03-05 19:32:35 +03:00 committed by Simon Ser
parent 4f5d6e4746
commit 4a968576e4
4 changed files with 49 additions and 14 deletions

View file

@ -26,6 +26,10 @@ void create_xdg_popup(struct wlr_xdg_surface *surface,
void unmap_xdg_popup(struct wlr_xdg_popup *popup);
void destroy_xdg_popup(struct wlr_xdg_popup *popup);
void handle_xdg_popup_committed(struct wlr_xdg_popup *popup);
struct wlr_xdg_popup_configure *send_xdg_popup_configure(
struct wlr_xdg_popup *popup);
void handle_xdg_popup_ack_configure(struct wlr_xdg_popup *popup,
struct wlr_xdg_popup_configure *configure);
void create_xdg_toplevel(struct wlr_xdg_surface *surface,
uint32_t id);

View file

@ -70,6 +70,11 @@ struct wlr_xdg_positioner {
struct wlr_xdg_positioner_rules rules;
};
struct wlr_xdg_popup_configure {
struct wlr_box geometry;
struct wlr_xdg_positioner_rules rules;
};
struct wlr_xdg_popup {
struct wlr_xdg_surface *base;
struct wl_list link;
@ -79,12 +84,12 @@ struct wlr_xdg_popup {
struct wlr_surface *parent;
struct wlr_seat *seat;
struct wlr_xdg_popup_configure scheduled;
// Position of the popup relative to the upper left corner of the window
// geometry of the parent surface
struct wlr_box geometry;
struct wlr_xdg_positioner_rules positioner_rules;
struct wl_list grab_link; // wlr_xdg_popup_grab.popups
};
@ -173,7 +178,10 @@ struct wlr_xdg_surface_configure {
struct wl_list link; // wlr_xdg_surface.configure_list
uint32_t serial;
struct wlr_xdg_toplevel_configure *toplevel_configure;
union {
struct wlr_xdg_toplevel_configure *toplevel_configure;
struct wlr_xdg_popup_configure *popup_configure;
};
};
struct wlr_xdg_surface_state {