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

xwayland views may reposition themselves #228

Open
Hjdskes opened this issue Jan 15, 2022 · 0 comments · May be fixed by #283
Open

xwayland views may reposition themselves #228

Hjdskes opened this issue Jan 15, 2022 · 0 comments · May be fixed by #283
Labels
bug Something isn't working

Comments

@Hjdskes
Copy link
Collaborator

Hjdskes commented Jan 15, 2022

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>
@Hjdskes Hjdskes added the bug Something isn't working label Jan 15, 2022
djpohly added a commit to djpohly/cage that referenced this issue Oct 16, 2023
Presumably this fixes cage-kiosk#228.  The position of the scene node for XWayland
override-redirect windows was never being set.
@djpohly djpohly linked a pull request Oct 16, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant