Fix initial position of X11 override-redirects#283
Fix initial position of X11 override-redirects#283djpohly wants to merge 3 commits intocage-kiosk:masterfrom
Conversation
Presumably this fixes cage-kiosk#228. The position of the scene node for XWayland override-redirect windows was never being set.
|
|
Good points, both. Updated. Edit: Further updated to fix a segfault when a window is mapped, unmapped, moved, and mapped again. There's a little bit of null-checking clunkiness here, because set_geometry can happen while a window is unmapped, but the scene node in cage only exists while the window is mapped. An alternative would be for each view to have an empty "container" node that always exists, then add/remove the surface tree as a child of that container on map/unmap. |
A null check had to be added because, since a view's scene isn't created until .map, there's a possibility that .set_geometry is called before the scene node exists.
802b747 to
14ba8d3
Compare
|
Is there anything blocking this from getting merged? It fixes positioning issues with Steam's dropdown menus. |
| xwayland_view->view.lx = xwayland_surface->x; | ||
| xwayland_view->view.ly = xwayland_surface->y; |
There was a problem hiding this comment.
Hm, should we add a if (!xwayland_view_should_manage(view)) here?
There was a problem hiding this comment.
Then it wouldn't cover the case where override_redirect is set between creating and mapping the window, e.g.:
Window w = XCreateSimpleWindow(dpy, root, 100, 100, 50, 50, 3, 0xffff00, 0xff00ff);
XSetWindowAttributes attrs = { .override_redirect = True };
XChangeWindowAttributes(dpy, w, CWOverrideRedirect, &attrs);
// Should appear at position (100, 100)
XMapWindow(dpy, w);
XFlush(dpy);There was a problem hiding this comment.
Hm… What about override redirect changing after the window is unmapped? Sounds like we should probably set up a set_override_redirect listener to handle all cases correctly?
I'd be more comfortable only copying the X11 position when the window is O-R.
Presumably this fixes #228. The position of the scene node for XWayland override-redirect windows was never being set.