diff --git a/view.c b/view.c index 1560885..d1483c4 100644 --- a/view.c +++ b/view.c @@ -56,7 +56,7 @@ view_child_handle_commit(struct wl_listener *listener, void *_data) { struct cg_view_child *child = wl_container_of(listener, child, commit); int x, y; child->get_coords(child, &x, &y); - view_damage_child(child, x, y, false); + view_damage_child(child, x+child->view->ox, y+child->view->oy, false); } static void @@ -120,8 +120,7 @@ subsurface_handle_destroy(struct wl_listener *listener, void *_data) { static void subsurface_get_coords(struct cg_view_child *child, int *x, int *y) { struct wlr_surface *surface = child->wlr_surface; - *x = -child->view->ox; - *y = -child->view->oy; + *x=*y=0; if(child->parent && child->parent->get_coords) { int sx, sy; diff --git a/view.h b/view.h index bcb8908..b7cc426 100644 --- a/view.h +++ b/view.h @@ -83,6 +83,8 @@ view_damage_part(struct cg_view *view); void view_damage_whole(struct cg_view *view); void +view_damage_child(struct cg_view_child *view, int x, int y, bool whole); +void view_activate(struct cg_view *view, bool activate); void view_position(struct cg_view *view); diff --git a/xdg_shell.c b/xdg_shell.c index 7d8ee4f..1cd349d 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -59,7 +59,10 @@ xdg_popup_destroy(struct cg_view_child *child) { return; } - struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; + int x, y; + child->get_coords(child, &x, &y); + view_damage_child(child, x+child->view->ox, y+child->view->oy, true); +struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; wl_list_remove(&popup->destroy.link); wl_list_remove(&popup->map.link); wl_list_remove(&popup->unmap.link); @@ -128,8 +131,8 @@ xdg_popup_get_coords(struct cg_view_child *child, int *x, int *y) { struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; struct wlr_xdg_surface *surface = popup->wlr_popup->base; - int x_offset = -surface->geometry.x - child->view->ox; - int y_offset = -surface->geometry.y - child->view->oy; + int x_offset = -surface->geometry.x; + int y_offset = -surface->geometry.y; wlr_xdg_popup_get_toplevel_coords( surface->popup, x_offset + surface->popup->geometry.x,