aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
Diffstat (limited to 'rootston')
-rw-r--r--rootston/main.c3
-rw-r--r--rootston/output.c6
-rw-r--r--rootston/seat.c15
-rw-r--r--rootston/xdg_shell.c12
-rw-r--r--rootston/xdg_shell_v6.c12
5 files changed, 27 insertions, 21 deletions
diff --git a/rootston/main.c b/rootston/main.c
index 07a41d5d..8a0205f2 100644
--- a/rootston/main.c
+++ b/rootston/main.c
@@ -72,6 +72,9 @@ int main(int argc, char **argv) {
}
wl_display_run(server.wl_display);
+#ifdef WLR_HAS_XWAYLAND
+ wlr_xwayland_destroy(server.desktop->xwayland);
+#endif
wl_display_destroy_clients(server.wl_display);
wl_display_destroy(server.wl_display);
return 0;
diff --git a/rootston/output.c b/rootston/output.c
index faa808d1..353d431f 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -189,7 +189,8 @@ static void render_surface(struct wlr_surface *surface, int sx, int sy,
struct roots_output *output = data->output;
float rotation = data->layout.rotation;
- if (!wlr_surface_has_buffer(surface)) {
+ struct wlr_texture *texture = wlr_surface_get_texture(surface);
+ if (texture == NULL) {
return;
}
@@ -230,8 +231,7 @@ static void render_surface(struct wlr_surface *surface, int sx, int sy,
pixman_box32_t *rects = pixman_region32_rectangles(&damage, &nrects);
for (int i = 0; i < nrects; ++i) {
scissor_output(output, &rects[i]);
- wlr_render_texture_with_matrix(renderer, surface->texture, matrix,
- data->alpha);
+ wlr_render_texture_with_matrix(renderer, texture, matrix, data->alpha);
}
damage_finish:
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/rootston/xdg_shell.c b/rootston/xdg_shell.c
index 03ae1dc6..805fb874 100644
--- a/rootston/xdg_shell.c
+++ b/rootston/xdg_shell.c
@@ -132,14 +132,10 @@ static void get_size(const struct roots_view *view, struct wlr_box *box) {
assert(view->type == ROOTS_XDG_SHELL_VIEW);
struct wlr_xdg_surface *surface = view->xdg_surface;
- if (surface->geometry.width > 0 && surface->geometry.height > 0) {
- box->width = surface->geometry.width;
- box->height = surface->geometry.height;
- } else {
- assert(surface->surface);
- box->width = surface->surface->current->width;
- box->height = surface->surface->current->height;
- }
+ struct wlr_box geo_box;
+ wlr_xdg_surface_get_geometry(surface, &geo_box);
+ box->width = geo_box.width;
+ box->height = geo_box.height;
}
static void activate(struct roots_view *view, bool active) {
diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c
index 90b11690..02ad867d 100644
--- a/rootston/xdg_shell_v6.c
+++ b/rootston/xdg_shell_v6.c
@@ -133,14 +133,10 @@ static void get_size(const struct roots_view *view, struct wlr_box *box) {
assert(view->type == ROOTS_XDG_SHELL_V6_VIEW);
struct wlr_xdg_surface_v6 *surface = view->xdg_surface_v6;
- if (surface->geometry.width > 0 && surface->geometry.height > 0) {
- box->width = surface->geometry.width;
- box->height = surface->geometry.height;
- } else {
- assert(surface->surface);
- box->width = surface->surface->current->width;
- box->height = surface->surface->current->height;
- }
+ struct wlr_box geo_box;
+ wlr_xdg_surface_v6_get_geometry(surface, &geo_box);
+ box->width = geo_box.width;
+ box->height = geo_box.height;
}
static void activate(struct roots_view *view, bool active) {