diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-14 15:47:51 -0400 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2018-04-23 11:22:23 +0200 |
commit | 6b7b64ec1eed0eb2d02c3de69f4352c21ed3c288 (patch) | |
tree | eefe21adc0fb16bbee321509e82fe97cff30b000 /include | |
parent | da944cccb3b118f01a5e8a5406c328ddb75822d7 (diff) |
Generalize xdg-shell popups and add to layer-shell
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_layer_shell.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_xdg_shell.h | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/include/wlr/types/wlr_layer_shell.h b/include/wlr/types/wlr_layer_shell.h index 79b3a4ea..4b3e4e1c 100644 --- a/include/wlr/types/wlr_layer_shell.h +++ b/include/wlr/types/wlr_layer_shell.h @@ -59,6 +59,7 @@ struct wlr_layer_surface { struct wlr_output *output; struct wl_resource *resource; struct wlr_layer_shell *shell; + struct wl_list popups; // wlr_xdg_popup::link const char *namespace; enum zwlr_layer_shell_v1_layer layer; @@ -81,6 +82,7 @@ struct wlr_layer_surface { struct wl_signal destroy; struct wl_signal map; struct wl_signal unmap; + struct wl_signal new_popup; } events; void *data; diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h index 5046339a..cf96df4a 100644 --- a/include/wlr/types/wlr_xdg_shell.h +++ b/include/wlr/types/wlr_xdg_shell.h @@ -32,15 +32,18 @@ struct wlr_xdg_client { struct wl_event_source *ping_timer; }; +struct wlr_xdg_positioner; + struct wlr_xdg_popup { struct wlr_xdg_surface *base; struct wl_list link; struct wl_resource *resource; bool committed; - struct wlr_xdg_surface *parent; + struct wlr_surface *parent; struct wlr_seat *seat; + struct wlr_xdg_positioner *positioner; // Position of the popup relative to the upper left corner of the window // geometry of the parent surface struct wlr_box geometry; @@ -178,6 +181,11 @@ struct wlr_xdg_toplevel_show_window_menu_event { struct wlr_xdg_shell *wlr_xdg_shell_create(struct wl_display *display); void wlr_xdg_shell_destroy(struct wlr_xdg_shell *xdg_shell); +struct wlr_xdg_surface *wlr_xdg_surface_from_resource( + struct wl_resource *resource); + +struct wlr_box wlr_xdg_popup_get_geometry(struct wlr_xdg_popup *popup); + /** * Send a ping to the surface. If the surface does not respond in a reasonable * amount of time, the ping_timeout event will be emitted. @@ -226,6 +234,7 @@ void wlr_xdg_surface_send_close(struct wlr_xdg_surface *surface); /** * Compute the popup position in its parent's surface-local coordinate system. + * This aborts if called for popups whose parent is not an xdg_surface. */ void wlr_xdg_surface_popup_get_position(struct wlr_xdg_surface *surface, double *popup_sx, double *popup_sy); |