Merge pull request #3864 from kosorin/fix/redraw-drawable

Redraw drawable when changing geometry
This commit is contained in:
mergify[bot] 2023-11-19 01:43:10 +00:00 committed by GitHub
commit 375d9d7235
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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);