From 90a3a992aef61841d36491868e9fa588714ebc61 Mon Sep 17 00:00:00 2001 From: David Kosorin Date: Mon, 10 Apr 2023 20:18:20 +0200 Subject: [PATCH] Redraw drawable when changing geometry --- objects/drawable.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/objects/drawable.c b/objects/drawable.c index 56449c0e8..0db78ca6a 100644 --- a/objects/drawable.c +++ b/objects/drawable.c @@ -141,10 +141,10 @@ drawable_set_geometry(lua_State *L, int didx, area_t geom) area_t old = d->geometry; d->geometry = geom; - bool size_changed = (old.width != geom.width) || (old.height != geom.height); - if (size_changed) + bool area_changed = !AREA_EQUAL(old, geom); + if (area_changed) drawable_unset_surface(d); - if (size_changed && geom.width > 0 && geom.height > 0) + if (area_changed && geom.width > 0 && geom.height > 0) { d->pixmap = xcb_generate_id(globalconf.connection); xcb_create_pixmap(globalconf.connection, globalconf.default_depth, d->pixmap, @@ -155,7 +155,7 @@ drawable_set_geometry(lua_State *L, int didx, area_t geom) luaA_object_emit_signal(L, didx, "property::surface", 0); } - if (!AREA_EQUAL(old, geom)) + if (area_changed) luaA_object_emit_signal(L, didx, "property::geometry", 0); if (old.x != geom.x) luaA_object_emit_signal(L, didx, "property::x", 0);