aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/rootston/seat.h4
-rw-r--r--include/wlr/types/wlr_data_device.h5
-rw-r--r--include/wlr/types/wlr_seat.h2
-rw-r--r--include/wlr/types/wlr_surface.h2
-rw-r--r--include/wlr/types/wlr_xdg_shell.h1
-rw-r--r--include/wlr/types/wlr_xdg_shell_v6.h1
-rw-r--r--rootston/seat.c15
-rw-r--r--types/data_device/wlr_drag.c26
-rw-r--r--types/seat/wlr_seat.c74
-rw-r--r--types/wlr_box.c8
-rw-r--r--types/wlr_linux_dmabuf.c3
-rw-r--r--types/wlr_surface.c12
-rw-r--r--types/xdg_shell/wlr_xdg_popup.c6
-rw-r--r--types/xdg_shell/wlr_xdg_positioner.c2
-rw-r--r--types/xdg_shell/wlr_xdg_toplevel.c2
-rw-r--r--types/xdg_shell_v6/wlr_xdg_popup_v6.c6
-rw-r--r--types/xdg_shell_v6/wlr_xdg_toplevel_v6.c2
17 files changed, 117 insertions, 54 deletions
diff --git a/include/rootston/seat.h b/include/rootston/seat.h
index d2ef90f3..0e3043dd 100644
--- a/include/rootston/seat.h
+++ b/include/rootston/seat.h
@@ -59,6 +59,7 @@ struct roots_drag_icon {
struct wl_listener surface_commit;
struct wl_listener map;
+ struct wl_listener unmap;
struct wl_listener destroy;
};
@@ -94,9 +95,6 @@ void roots_seat_destroy(struct roots_seat *seat);
void roots_seat_add_device(struct roots_seat *seat,
struct wlr_input_device *device);
-void roots_seat_remove_device(struct roots_seat *seat,
- struct wlr_input_device *device);
-
void roots_seat_configure_cursor(struct roots_seat *seat);
void roots_seat_configure_xcursor(struct roots_seat *seat);
diff --git a/include/wlr/types/wlr_data_device.h b/include/wlr/types/wlr_data_device.h
index 80d4bc8b..4de4d610 100644
--- a/include/wlr/types/wlr_data_device.h
+++ b/include/wlr/types/wlr_data_device.h
@@ -88,12 +88,15 @@ struct wlr_drag_icon {
int32_t sx, sy;
struct {
- struct wl_signal map; // emitted when mapped or unmapped
+ struct wl_signal map;
+ struct wl_signal unmap;
struct wl_signal destroy;
} events;
struct wl_listener surface_destroy;
struct wl_listener seat_client_destroy;
+
+ void *data;
};
struct wlr_drag {
diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h
index f4840c89..5e04003d 100644
--- a/include/wlr/types/wlr_seat.h
+++ b/include/wlr/types/wlr_seat.h
@@ -13,11 +13,11 @@
* managed by wlr_seat; some may be NULL.
*/
struct wlr_seat_client {
- struct wl_resource *wl_resource;
struct wl_client *client;
struct wlr_seat *seat;
// lists of wl_resource
+ struct wl_list wl_resources;
struct wl_list pointers;
struct wl_list keyboards;
struct wl_list touches;
diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h
index 0fa7e9c2..526e4e2c 100644
--- a/include/wlr/types/wlr_surface.h
+++ b/include/wlr/types/wlr_surface.h
@@ -62,6 +62,8 @@ struct wlr_subsurface {
struct {
struct wl_signal destroy;
} events;
+
+ void *data;
};
struct wlr_surface {
diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h
index 6a967bc7..01dc17fe 100644
--- a/include/wlr/types/wlr_xdg_shell.h
+++ b/include/wlr/types/wlr_xdg_shell.h
@@ -118,6 +118,7 @@ struct wlr_xdg_toplevel {
struct wl_signal request_move;
struct wl_signal request_resize;
struct wl_signal request_show_window_menu;
+ struct wl_signal set_parent;
} events;
};
diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h
index 07c831ce..5f98eb13 100644
--- a/include/wlr/types/wlr_xdg_shell_v6.h
+++ b/include/wlr/types/wlr_xdg_shell_v6.h
@@ -126,6 +126,7 @@ struct wlr_xdg_toplevel_v6 {
struct wl_signal request_move;
struct wl_signal request_resize;
struct wl_signal request_show_window_menu;
+ struct wl_signal set_parent;
} events;
};
diff --git a/rootston/seat.c b/rootston/seat.c
index b137ff11..91561567 100644
--- a/rootston/seat.c
+++ b/rootston/seat.c
@@ -260,7 +260,7 @@ static void roots_drag_icon_handle_surface_commit(struct wl_listener *listener,
void *data) {
struct roots_drag_icon *icon =
wl_container_of(listener, icon, surface_commit);
- roots_drag_icon_damage_whole(icon);
+ roots_drag_icon_update_position(icon);
}
static void roots_drag_icon_handle_map(struct wl_listener *listener,
@@ -270,6 +270,13 @@ static void roots_drag_icon_handle_map(struct wl_listener *listener,
roots_drag_icon_damage_whole(icon);
}
+static void roots_drag_icon_handle_unmap(struct wl_listener *listener,
+ void *data) {
+ struct roots_drag_icon *icon =
+ wl_container_of(listener, icon, unmap);
+ roots_drag_icon_damage_whole(icon);
+}
+
static void roots_drag_icon_handle_destroy(struct wl_listener *listener,
void *data) {
struct roots_drag_icon *icon =
@@ -278,7 +285,7 @@ static void roots_drag_icon_handle_destroy(struct wl_listener *listener,
wl_list_remove(&icon->link);
wl_list_remove(&icon->surface_commit.link);
- wl_list_remove(&icon->map.link);
+ wl_list_remove(&icon->unmap.link);
wl_list_remove(&icon->destroy.link);
free(icon);
}
@@ -297,12 +304,16 @@ static void roots_seat_handle_new_drag_icon(struct wl_listener *listener,
icon->surface_commit.notify = roots_drag_icon_handle_surface_commit;
wl_signal_add(&wlr_drag_icon->surface->events.commit, &icon->surface_commit);
+ icon->unmap.notify = roots_drag_icon_handle_unmap;
+ wl_signal_add(&wlr_drag_icon->events.unmap, &icon->unmap);
icon->map.notify = roots_drag_icon_handle_map;
wl_signal_add(&wlr_drag_icon->events.map, &icon->map);
icon->destroy.notify = roots_drag_icon_handle_destroy;
wl_signal_add(&wlr_drag_icon->events.destroy, &icon->destroy);
wl_list_insert(&seat->drag_icons, &icon->link);
+
+ roots_drag_icon_update_position(icon);
}
void roots_drag_icon_update_position(struct roots_drag_icon *icon) {
diff --git a/types/data_device/wlr_drag.c b/types/data_device/wlr_drag.c
index 331fba2f..4f0b2521 100644
--- a/types/data_device/wlr_drag.c
+++ b/types/data_device/wlr_drag.c
@@ -44,7 +44,7 @@ static void drag_set_focus(struct wlr_drag *drag,
if (!drag->source &&
wl_resource_get_client(surface->resource) !=
- wl_resource_get_client(drag->seat_client->wl_resource)) {
+ drag->seat_client->client) {
return;
}
@@ -98,6 +98,16 @@ static void drag_set_focus(struct wlr_drag *drag,
wlr_signal_emit_safe(&drag->events.focus, drag);
}
+static void drag_icon_set_mapped(struct wlr_drag_icon *icon, bool mapped) {
+ if (mapped && !icon->mapped) {
+ icon->mapped = true;
+ wlr_signal_emit_safe(&icon->events.map, icon);
+ } else if (!mapped && icon->mapped) {
+ icon->mapped = false;
+ wlr_signal_emit_safe(&icon->events.unmap, icon);
+ }
+}
+
static void drag_end(struct wlr_drag *drag) {
if (!drag->cancelling) {
drag->cancelling = true;
@@ -115,9 +125,8 @@ static void drag_end(struct wlr_drag *drag) {
drag_set_focus(drag, NULL, 0, 0);
if (drag->icon) {
- drag->icon->mapped = false;
wl_list_remove(&drag->icon_destroy.link);
- wlr_signal_emit_safe(&drag->icon->events.map, drag->icon);
+ drag_icon_set_mapped(drag->icon, false);
}
wlr_signal_emit_safe(&drag->events.destroy, drag);
@@ -310,9 +319,10 @@ static void drag_handle_drag_source_destroy(struct wl_listener *listener,
static void drag_icon_destroy(struct wlr_drag_icon *icon) {
- if (!icon) {
+ if (icon == NULL) {
return;
}
+ drag_icon_set_mapped(icon, false);
wlr_signal_emit_safe(&icon->events.destroy, icon);
wlr_surface_set_role_committed(icon->surface, NULL, NULL);
wl_list_remove(&icon->surface_destroy.link);
@@ -333,6 +343,8 @@ static void drag_icon_handle_surface_commit(struct wlr_surface *surface,
struct wlr_drag_icon *icon = role_data;
icon->sx += icon->surface->current->sx;
icon->sy += icon->surface->current->sy;
+
+ drag_icon_set_mapped(icon, wlr_surface_has_buffer(surface));
}
static void drag_icon_handle_seat_client_destroy(struct wl_listener *listener,
@@ -355,9 +367,9 @@ static struct wlr_drag_icon *drag_icon_create(
icon->client = client;
icon->is_pointer = is_pointer;
icon->touch_id = touch_id;
- icon->mapped = true;
wl_signal_init(&icon->events.map);
+ wl_signal_init(&icon->events.unmap);
wl_signal_init(&icon->events.destroy);
wl_signal_add(&icon->surface->events.destroy, &icon->surface_destroy);
@@ -372,6 +384,10 @@ static struct wlr_drag_icon *drag_icon_create(
wl_list_insert(&client->seat->drag_icons, &icon->link);
wlr_signal_emit_safe(&client->seat->events.new_drag_icon, icon);
+ if (wlr_surface_has_buffer(icon_surface)) {
+ drag_icon_set_mapped(icon, true);
+ }
+
return icon;
}
diff --git a/types/seat/wlr_seat.c b/types/seat/wlr_seat.c
index 4a680157..ead4b0e7 100644
--- a/types/seat/wlr_seat.c
+++ b/types/seat/wlr_seat.c
@@ -60,6 +60,12 @@ static void seat_client_handle_resource_destroy(
struct wl_resource *seat_resource) {
struct wlr_seat_client *client =
wlr_seat_client_from_resource(seat_resource);
+
+ wl_list_remove(wl_resource_get_link(seat_resource));
+ if (!wl_list_empty(&client->wl_resources)) {
+ return;
+ }
+
wlr_signal_emit_safe(&client->events.destroy, client);
if (client == client->seat->pointer_state.focused_client) {
@@ -108,34 +114,43 @@ static void seat_handle_bind(struct wl_client *client, void *_wlr_seat,
struct wlr_seat *wlr_seat = _wlr_seat;
assert(client && wlr_seat);
- struct wlr_seat_client *seat_client =
- calloc(1, sizeof(struct wlr_seat_client));
- if (seat_client == NULL) {
- wl_client_post_no_memory(client);
- return;
- }
- seat_client->wl_resource =
+ struct wl_resource *wl_resource =
wl_resource_create(client, &wl_seat_interface, version, id);
- if (seat_client->wl_resource == NULL) {
- free(seat_client);
+ if (wl_resource == NULL) {
wl_client_post_no_memory(client);
return;
}
- seat_client->client = client;
- seat_client->seat = wlr_seat;
- wl_list_init(&seat_client->pointers);
- wl_list_init(&seat_client->keyboards);
- wl_list_init(&seat_client->touches);
- wl_list_init(&seat_client->data_devices);
- wl_list_init(&seat_client->primary_selection_devices);
- wl_resource_set_implementation(seat_client->wl_resource, &seat_impl,
+
+ struct wlr_seat_client *seat_client =
+ wlr_seat_client_for_wl_client(wlr_seat, client);
+ if (seat_client == NULL) {
+ seat_client = calloc(1, sizeof(struct wlr_seat_client));
+ if (seat_client == NULL) {
+ wl_resource_destroy(wl_resource);
+ wl_client_post_no_memory(client);
+ return;
+ }
+
+ seat_client->client = client;
+ seat_client->seat = wlr_seat;
+ wl_list_init(&seat_client->wl_resources);
+ wl_list_init(&seat_client->pointers);
+ wl_list_init(&seat_client->keyboards);
+ wl_list_init(&seat_client->touches);
+ wl_list_init(&seat_client->data_devices);
+ wl_list_init(&seat_client->primary_selection_devices);
+ wl_signal_init(&seat_client->events.destroy);
+
+ wl_list_insert(&wlr_seat->clients, &seat_client->link);
+ }
+
+ wl_resource_set_implementation(wl_resource, &seat_impl,
seat_client, seat_client_handle_resource_destroy);
- wl_list_insert(&wlr_seat->clients, &seat_client->link);
+ wl_list_insert(&seat_client->wl_resources, wl_resource_get_link(wl_resource));
if (version >= WL_SEAT_NAME_SINCE_VERSION) {
- wl_seat_send_name(seat_client->wl_resource, wlr_seat->name);
+ wl_seat_send_name(wl_resource, wlr_seat->name);
}
- wl_seat_send_capabilities(seat_client->wl_resource, wlr_seat->capabilities);
- wl_signal_init(&seat_client->events.destroy);
+ wl_seat_send_capabilities(wl_resource, wlr_seat->capabilities);
}
void wlr_seat_destroy(struct wlr_seat *seat) {
@@ -160,8 +175,11 @@ void wlr_seat_destroy(struct wlr_seat *seat) {
struct wlr_seat_client *client, *tmp;
wl_list_for_each_safe(client, tmp, &seat->clients, link) {
- // will destroy other resources as well
- wl_resource_destroy(client->wl_resource);
+ struct wl_resource *resource, *next_resource;
+ wl_resource_for_each_safe(resource, next_resource, &client->wl_resources) {
+ // will destroy other resources as well
+ wl_resource_destroy(resource);
+ }
}
wl_global_destroy(seat->wl_global);
@@ -308,7 +326,10 @@ void wlr_seat_set_capabilities(struct wlr_seat *wlr_seat,
}
}
- wl_seat_send_capabilities(client->wl_resource, capabilities);
+ struct wl_resource *resource;
+ wl_resource_for_each(resource, &client->wl_resources) {
+ wl_seat_send_capabilities(resource, capabilities);
+ }
}
}
@@ -317,7 +338,10 @@ void wlr_seat_set_name(struct wlr_seat *wlr_seat, const char *name) {
wlr_seat->name = strdup(name);
struct wlr_seat_client *client;
wl_list_for_each(client, &wlr_seat->clients, link) {
- wl_seat_send_name(client->wl_resource, name);
+ struct wl_resource *resource;
+ wl_resource_for_each(resource, &client->wl_resources) {
+ wl_seat_send_name(resource, name);
+ }
}
}
diff --git a/types/wlr_box.c b/types/wlr_box.c
index c92b0aa4..ada6a733 100644
--- a/types/wlr_box.c
+++ b/types/wlr_box.c
@@ -11,8 +11,8 @@ void wlr_box_closest_point(const struct wlr_box *box, double x, double y,
// find the closest x point
if (x < box->x) {
*dest_x = box->x;
- } else if (x > box->x + box->width) {
- *dest_x = box->x + box->width;
+ } else if (x >= box->x + box->width) {
+ *dest_x = box->x + box->width - 1;
} else {
*dest_x = x;
}
@@ -20,8 +20,8 @@ void wlr_box_closest_point(const struct wlr_box *box, double x, double y,
// find closest y point
if (y < box->y) {
*dest_y = box->y;
- } else if (y > box->y + box->height) {
- *dest_y = box->y + box->height;
+ } else if (y >= box->y + box->height) {
+ *dest_y = box->y + box->height - 1;
} else {
*dest_y = y;
}
diff --git a/types/wlr_linux_dmabuf.c b/types/wlr_linux_dmabuf.c
index 6e716986..3b4fc78b 100644
--- a/types/wlr_linux_dmabuf.c
+++ b/types/wlr_linux_dmabuf.c
@@ -101,7 +101,8 @@ static void params_add(struct wl_client *client,
if (buffer->has_modifier && modifier != buffer->attributes.modifier) {
wl_resource_post_error(params_resource,
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT,
- "sent modifier %lu for plane %u, expected modifier %lu like other planes",
+ "sent modifier %" PRIu64 " for plane %u, expected"
+ " modifier %" PRIu64 " like other planes",
modifier, plane_idx, buffer->attributes.modifier);
close(fd);
return;
diff --git a/types/wlr_surface.c b/types/wlr_surface.c
index 22026af8..9c3eb86d 100644
--- a/types/wlr_surface.c
+++ b/types/wlr_surface.c
@@ -805,7 +805,7 @@ static void subsurface_handle_place_above(struct wl_client *client,
}
wl_list_remove(&subsurface->parent_pending_link);
- wl_list_insert(sibling->parent_pending_link.prev,
+ wl_list_insert(&sibling->parent_pending_link,
&subsurface->parent_pending_link);
subsurface->reordered = true;
@@ -832,7 +832,7 @@ static void subsurface_handle_place_below(struct wl_client *client,
}
wl_list_remove(&subsurface->parent_pending_link);
- wl_list_insert(&sibling->parent_pending_link,
+ wl_list_insert(sibling->parent_pending_link.prev,
&subsurface->parent_pending_link);
subsurface->reordered = true;
@@ -933,8 +933,8 @@ struct wlr_subsurface *wlr_subsurface_create(struct wlr_surface *surface,
subsurface->parent = parent;
wl_signal_add(&parent->events.destroy, &subsurface->parent_destroy);
subsurface->parent_destroy.notify = subsurface_handle_parent_destroy;
- wl_list_insert(&parent->subsurfaces, &subsurface->parent_link);
- wl_list_insert(&parent->subsurface_pending_list,
+ wl_list_insert(parent->subsurfaces.prev, &subsurface->parent_link);
+ wl_list_insert(parent->subsurface_pending_list.prev,
&subsurface->parent_pending_link);
surface->role_data = subsurface;
@@ -956,7 +956,7 @@ struct wlr_surface *wlr_surface_get_root_surface(struct wlr_surface *surface) {
while (wlr_surface_is_subsurface(surface)) {
struct wlr_subsurface *subsurface =
wlr_subsurface_from_surface(surface);
- surface = subsurface->surface;
+ surface = subsurface->parent;
}
return surface;
}
@@ -971,7 +971,7 @@ bool wlr_surface_point_accepts_input(struct wlr_surface *surface,
struct wlr_surface *wlr_surface_surface_at(struct wlr_surface *surface,
double sx, double sy, double *sub_x, double *sub_y) {
struct wlr_subsurface *subsurface;
- wl_list_for_each(subsurface, &surface->subsurfaces, parent_link) {
+ wl_list_for_each_reverse(subsurface, &surface->subsurfaces, parent_link) {
double _sub_x = subsurface->surface->current->subsurface_position.x;
double _sub_y = subsurface->surface->current->subsurface_position.y;
struct wlr_surface *sub = wlr_surface_surface_at(subsurface->surface,
diff --git a/types/xdg_shell/wlr_xdg_popup.c b/types/xdg_shell/wlr_xdg_popup.c
index 9c8b6eb2..e7204def 100644
--- a/types/xdg_shell/wlr_xdg_popup.c
+++ b/types/xdg_shell/wlr_xdg_popup.c
@@ -416,7 +416,7 @@ static bool xdg_popup_unconstrain_slide(struct wlr_xdg_popup *popup,
(popup->positioner.constraint_adjustment &
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X);
- bool slide_y = offset_x &&
+ bool slide_y = offset_y &&
(popup->positioner.constraint_adjustment &
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y);
@@ -459,7 +459,7 @@ static bool xdg_popup_unconstrain_resize(struct wlr_xdg_popup *popup,
(popup->positioner.constraint_adjustment &
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_X);
- bool resize_y = offset_x &&
+ bool resize_y = offset_y &&
(popup->positioner.constraint_adjustment &
XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y);
@@ -471,7 +471,7 @@ static bool xdg_popup_unconstrain_resize(struct wlr_xdg_popup *popup,
}
xdg_popup_box_constraints(popup, toplevel_sx_box,
- &offset_y, &offset_y);
+ &offset_x, &offset_y);
return !offset_x && !offset_y;
}
diff --git a/types/xdg_shell/wlr_xdg_positioner.c b/types/xdg_shell/wlr_xdg_positioner.c
index 0213c572..6f902f92 100644
--- a/types/xdg_shell/wlr_xdg_positioner.c
+++ b/types/xdg_shell/wlr_xdg_positioner.c
@@ -256,6 +256,8 @@ static enum xdg_positioner_anchor positioner_anchor_invert_x(
return XDG_POSITIONER_ANCHOR_LEFT;
case XDG_POSITIONER_ANCHOR_TOP_LEFT:
return XDG_POSITIONER_ANCHOR_TOP_RIGHT;
+ case XDG_POSITIONER_ANCHOR_TOP_RIGHT:
+ return XDG_POSITIONER_ANCHOR_TOP_LEFT;
case XDG_POSITIONER_ANCHOR_BOTTOM_LEFT:
return XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT;
case XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT:
diff --git a/types/xdg_shell/wlr_xdg_toplevel.c b/types/xdg_shell/wlr_xdg_toplevel.c
index 5968c835..fa0ec929 100644
--- a/types/xdg_shell/wlr_xdg_toplevel.c
+++ b/types/xdg_shell/wlr_xdg_toplevel.c
@@ -218,6 +218,7 @@ static void xdg_toplevel_handle_set_parent(struct wl_client *client,
}
surface->toplevel->parent = parent;
+ wlr_signal_emit_safe(&surface->toplevel->events.set_parent, surface);
}
static void xdg_toplevel_handle_set_title(struct wl_client *client,
@@ -464,6 +465,7 @@ void create_xdg_toplevel(struct wlr_xdg_surface *xdg_surface,
wl_signal_init(&xdg_surface->toplevel->events.request_move);
wl_signal_init(&xdg_surface->toplevel->events.request_resize);
wl_signal_init(&xdg_surface->toplevel->events.request_show_window_menu);
+ wl_signal_init(&xdg_surface->toplevel->events.set_parent);
xdg_surface->role = WLR_XDG_SURFACE_ROLE_TOPLEVEL;
xdg_surface->toplevel->base = xdg_surface;
diff --git a/types/xdg_shell_v6/wlr_xdg_popup_v6.c b/types/xdg_shell_v6/wlr_xdg_popup_v6.c
index a75201d0..ff66e812 100644
--- a/types/xdg_shell_v6/wlr_xdg_popup_v6.c
+++ b/types/xdg_shell_v6/wlr_xdg_popup_v6.c
@@ -443,7 +443,7 @@ static bool xdg_popup_v6_unconstrain_slide(struct wlr_xdg_popup_v6 *popup,
(popup->positioner.constraint_adjustment &
ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X);
- bool slide_y = offset_x &&
+ bool slide_y = offset_y &&
(popup->positioner.constraint_adjustment &
ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y);
@@ -486,7 +486,7 @@ static bool xdg_popup_v6_unconstrain_resize(struct wlr_xdg_popup_v6 *popup,
(popup->positioner.constraint_adjustment &
ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X);
- bool resize_y = offset_x &&
+ bool resize_y = offset_y &&
(popup->positioner.constraint_adjustment &
ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y);
@@ -498,7 +498,7 @@ static bool xdg_popup_v6_unconstrain_resize(struct wlr_xdg_popup_v6 *popup,
}
xdg_popup_v6_box_constraints(popup, toplevel_sx_box,
- &offset_y, &offset_y);
+ &offset_x, &offset_y);
return !offset_x && !offset_y;
}
diff --git a/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c b/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c
index 2bcfaf0d..0f9a26d3 100644
--- a/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c
+++ b/types/xdg_shell_v6/wlr_xdg_toplevel_v6.c
@@ -42,6 +42,7 @@ static void xdg_toplevel_handle_set_parent(struct wl_client *client,
}
surface->toplevel->parent = parent;
+ wlr_signal_emit_safe(&surface->toplevel->events.set_parent, surface);
}
static void xdg_toplevel_handle_set_title(struct wl_client *client,
@@ -434,6 +435,7 @@ void create_xdg_toplevel_v6(struct wlr_xdg_surface_v6 *xdg_surface,
wl_signal_init(&xdg_surface->toplevel->events.request_move);
wl_signal_init(&xdg_surface->toplevel->events.request_resize);
wl_signal_init(&xdg_surface->toplevel->events.request_show_window_menu);
+ wl_signal_init(&xdg_surface->toplevel->events.set_parent);
xdg_surface->role = WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL;
xdg_surface->toplevel->base = xdg_surface;