Skip to content

xwayland views may reposition themselves #228

@Hjdskes

Description

@Hjdskes

From #176:

Sometimes, xwayland views may reposition themselves. This is not handled correctly leading to some dropdown menus appearing in wrong positions. In order to circumvent this, we added something similar to the following patch to cagebreak (I'm not quite sure if this is the correct use of lx and ly in your convention and haven't been able to conclusively test this due to the NPD bug above). We are also experiencing something similar with xdg_popup at the moment in Cagebreak but haven't figured out yet what is happening there.

Proposed patch:

```diff diff --git a/xwayland.c b/xwayland.c index 53c9768..aa55307 100644 --- a/xwayland.c +++ b/xwayland.c @@ -119,9 +119,28 @@ handle_xwayland_surface_request_fullscreen(struct wl_listener *listener, void *d static void handle_xwayland_surface_commit(struct wl_listener *listener, void *data) { - struct cg_xwayland_view *xwayland_view = wl_container_of(listener, xwayland_view, commit); + struct cg_xwayland_view *xwayland_view = + wl_container_of(listener, xwayland_view, commit); struct cg_view *view = &xwayland_view->view; - view_damage_part(view); + /* xwayland surface has moved */ + if(xwayland_view->xwayland_surface->x != view->lx || + xwayland_view->xwayland_surface->y != view->ly) { + struct cg_output *output; + wl_list_for_each (output, &view->server->outputs, link) { + + output_damage_surface(output, view->wlr_surface, + view->lx, view->ly, true); + } + view->lx = xwayland_view->xwayland_surface->x; + view->ly = xwayland_view->xwayland_surface->y; + wl_list_for_each (output, &view->server->outputs, link) { + + output_damage_surface(output, view->wlr_surface, + view->lx, view->ly, true); + } + } else { + view_damage_part(view); + } }

static void

</details>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions