Damage on move and resize

This commit is contained in:
buffet 2021-08-14 20:06:00 +00:00
parent cd5ce00f74
commit 64aad5b332
3 changed files with 22 additions and 2 deletions

View file

@ -104,6 +104,7 @@ const char *view_get_app_id(struct kiwmi_view *view);
const char *view_get_title(struct kiwmi_view *view);
void view_set_activated(struct kiwmi_view *view, bool activated);
void view_set_size(struct kiwmi_view *view, uint32_t width, uint32_t height);
void view_set_pos(struct kiwmi_view *view, uint32_t x, uint32_t y);
void view_set_tiled(struct kiwmi_view *view, enum wlr_edges edges);
struct wlr_surface *view_surface_at(
struct kiwmi_view *view,

View file

@ -85,6 +85,23 @@ view_set_size(struct kiwmi_view *view, uint32_t width, uint32_t height)
{
if (view->impl->set_size) {
view->impl->set_size(view, width, height);
struct kiwmi_output *output;
wl_list_for_each (output, &view->desktop->outputs, link) {
output->damaged = true;
}
}
}
void
view_set_pos(struct kiwmi_view *view, uint32_t x, uint32_t y)
{
view->x = x;
view->y = y;
struct kiwmi_output *output;
wl_list_for_each (output, &view->desktop->outputs, link) {
output->damaged = true;
}
}

View file

@ -239,8 +239,10 @@ l_kiwmi_view_move(lua_State *L)
luaL_checktype(L, 2, LUA_TNUMBER);
luaL_checktype(L, 3, LUA_TNUMBER);
view->x = lua_tonumber(L, 2);
view->y = lua_tonumber(L, 3);
uint32_t x = lua_tonumber(L, 2);
uint32_t y = lua_tonumber(L, 3);
view_set_pos(view, x, y);
return 0;
}