mirror of
https://cagebreak.project-repo.co/cagebreak.git
synced 2026-08-20 12:34:18 +02:00
Fix rendering of cg_view_child objects
This commit is contained in:
parent
e31fd8f4ba
commit
a08b84b381
3 changed files with 10 additions and 6 deletions
5
view.c
5
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;
|
||||
|
|
|
|||
2
view.h
2
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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue