From 0c337629cfdf0702fe4b2bc43d462bc8f50824b3 Mon Sep 17 00:00:00 2001 From: TheAvidDev Date: Mon, 31 Aug 2020 19:05:12 -0400 Subject: [PATCH] Fix segfault related to getting texture dimensions Fixes #11 --- sway/desktop/transaction.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index ae53f1772..2c940d919 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c @@ -207,9 +207,13 @@ static void apply_workspace_state(struct sway_workspace *ws, static void apply_container_state(struct sway_container *container, struct sway_container_state *state) { + int tw = 0, th = 0; + struct wlr_texture *texture = config->border_textures.focused.texture; + if (texture) { + wlr_texture_get_size(texture, &tw, &th); + } + struct sway_view *view = container->view; - int tw, th; - wlr_texture_get_size(config->border_textures.focused.texture, &tw, &th); // Damage the old location desktop_damage_whole_container(container); if (view && !wl_list_empty(&view->saved_buffers)) {