Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redraw drawable when changing geometry #3864

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions objects/drawable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand Down
Loading