Skip to content

Commit 0c33762

Browse files
committed
Fix segfault related to getting texture dimensions
Fixes swaywm#11
1 parent 93318d2 commit 0c33762

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sway/desktop/transaction.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,13 @@ static void apply_workspace_state(struct sway_workspace *ws,
207207

208208
static void apply_container_state(struct sway_container *container,
209209
struct sway_container_state *state) {
210+
int tw = 0, th = 0;
211+
struct wlr_texture *texture = config->border_textures.focused.texture;
212+
if (texture) {
213+
wlr_texture_get_size(texture, &tw, &th);
214+
}
215+
210216
struct sway_view *view = container->view;
211-
int tw, th;
212-
wlr_texture_get_size(config->border_textures.focused.texture, &tw, &th);
213217
// Damage the old location
214218
desktop_damage_whole_container(container);
215219
if (view && !wl_list_empty(&view->saved_buffers)) {

0 commit comments

Comments
 (0)