aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Primak <vyivel@posteo.net>2021-09-11 12:55:15 +0300
committerSimon Ser <contact@emersion.fr>2021-09-11 12:11:55 +0200
commit52da68b591bedbbf8a01d74b2f08307a28b058c9 (patch)
tree259e1377829fcdb78177b30a3fafee68701ab32e
parente479dc1ef0fe5165cd2456927cdf153ce206e023 (diff)
xdg popup: move function to a file it belongs to
-rw-r--r--types/xdg_shell/wlr_xdg_popup.c15
-rw-r--r--types/xdg_shell/wlr_xdg_positioner.c16
2 files changed, 15 insertions, 16 deletions
diff --git a/types/xdg_shell/wlr_xdg_popup.c b/types/xdg_shell/wlr_xdg_popup.c
index 460cfbc7..33f1c20f 100644
--- a/types/xdg_shell/wlr_xdg_popup.c
+++ b/types/xdg_shell/wlr_xdg_popup.c
@@ -196,6 +196,21 @@ struct wlr_xdg_popup_grab *get_xdg_shell_popup_grab_from_seat(
return xdg_grab;
}
+void handle_xdg_surface_popup_committed(struct wlr_xdg_surface *surface) {
+ assert(surface->role == WLR_XDG_SURFACE_ROLE_POPUP);
+
+ if (!surface->popup->parent) {
+ wl_resource_post_error(surface->resource,
+ XDG_SURFACE_ERROR_NOT_CONSTRUCTED,
+ "xdg_popup has no parent");
+ return;
+ }
+
+ if (!surface->popup->committed) {
+ schedule_xdg_surface_configure(surface);
+ surface->popup->committed = true;
+ }
+}
static const struct xdg_popup_interface xdg_popup_implementation;
diff --git a/types/xdg_shell/wlr_xdg_positioner.c b/types/xdg_shell/wlr_xdg_positioner.c
index a4cb9e31..aa149cc2 100644
--- a/types/xdg_shell/wlr_xdg_positioner.c
+++ b/types/xdg_shell/wlr_xdg_positioner.c
@@ -140,22 +140,6 @@ void create_xdg_positioner(struct wlr_xdg_client *client, uint32_t id) {
positioner, xdg_positioner_handle_resource_destroy);
}
-void handle_xdg_surface_popup_committed(struct wlr_xdg_surface *surface) {
- assert(surface->role == WLR_XDG_SURFACE_ROLE_POPUP);
-
- if (!surface->popup->parent) {
- wl_resource_post_error(surface->resource,
- XDG_SURFACE_ERROR_NOT_CONSTRUCTED,
- "xdg_popup has no parent");
- return;
- }
-
- if (!surface->popup->committed) {
- schedule_xdg_surface_configure(surface);
- surface->popup->committed = true;
- }
-}
-
static bool positioner_anchor_has_edge(enum xdg_positioner_anchor anchor,
enum xdg_positioner_anchor edge) {
switch (edge) {