From f9ad63c5cb8aa3cccadcbf85fd3e43070f41f026 Mon Sep 17 00:00:00 2001 From: emersion Date: Tue, 29 May 2018 22:50:26 +0100 Subject: rootston: use wl_display_destroy_clients --- rootston/main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'rootston') diff --git a/rootston/main.c b/rootston/main.c index cecdb23d..07a41d5d 100644 --- a/rootston/main.c +++ b/rootston/main.c @@ -72,6 +72,7 @@ int main(int argc, char **argv) { } wl_display_run(server.wl_display); + wl_display_destroy_clients(server.wl_display); wl_display_destroy(server.wl_display); return 0; } -- cgit v1.2.3 From 32013abae63f1c31598ac716acd7e73c24fadae1 Mon Sep 17 00:00:00 2001 From: Genki Sky Date: Wed, 30 May 2018 20:11:58 -0400 Subject: rootston: xdg-shell*: Fix get_size() for newly-mapped views The user-visible issue is that newly-mapped xdg-shell* windows would sometimes start with their top-left-corner, rather than their center, in the center of the screen. This is because get_size() would conservatively fall back on (width, height) == (0, 0) if both set_window_geometry() had not been called, and it found view->wlr_surface to be NULL. But, view->wlr_surface is only set to non-NULL in view_map(). We call get_size() before this. Fortunately, the wlr_surface in question is accessible via view->xdg_shell{,_v6}->surface, so always fall back on that. We can assert its presence instead of further falling back on (width, height) == (0, 0). Signed-off-by: Genki Sky --- rootston/xdg_shell.c | 7 +++---- rootston/xdg_shell_v6.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'rootston') diff --git a/rootston/xdg_shell.c b/rootston/xdg_shell.c index 83a1caf0..03ae1dc6 100644 --- a/rootston/xdg_shell.c +++ b/rootston/xdg_shell.c @@ -135,11 +135,10 @@ static void get_size(const struct roots_view *view, struct wlr_box *box) { if (surface->geometry.width > 0 && surface->geometry.height > 0) { box->width = surface->geometry.width; box->height = surface->geometry.height; - } else if (view->wlr_surface != NULL) { - box->width = view->wlr_surface->current->width; - box->height = view->wlr_surface->current->height; } else { - box->width = box->height = 0; + assert(surface->surface); + box->width = surface->surface->current->width; + box->height = surface->surface->current->height; } } diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c index 5a829f5d..90b11690 100644 --- a/rootston/xdg_shell_v6.c +++ b/rootston/xdg_shell_v6.c @@ -136,11 +136,10 @@ static void get_size(const struct roots_view *view, struct wlr_box *box) { if (surface->geometry.width > 0 && surface->geometry.height > 0) { box->width = surface->geometry.width; box->height = surface->geometry.height; - } else if (view->wlr_surface != NULL) { - box->width = view->wlr_surface->current->width; - box->height = view->wlr_surface->current->height; } else { - box->width = box->height = 0; + assert(surface->surface); + box->width = surface->surface->current->width; + box->height = surface->surface->current->height; } } -- cgit v1.2.3