opt&fix: made viewport pan to the newly focused window when the focused window is killed and fixed xwayland window issues getting their geom overwritten by the x server

This commit is contained in:
ernestoCruz05 2026-03-31 16:43:32 +01:00
parent b509004f4a
commit 601b8cffcf
2 changed files with 14 additions and 0 deletions

View file

@ -195,6 +195,12 @@ static void canvas_reposition(Monitor *m) {
wlr_scene_node_set_position(&c->scene->node, new_x, new_y);
#ifdef XWAYLAND
if (client_is_x11(c))
client_set_size(c, c->geom.width - 2 * c->bw,
c->geom.height - 2 * c->bw);
#endif
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, NULL);
client_apply_clip(c, 1.0);
if (zoom != 1.0f && !c->is_clip_to_hide)

View file

@ -6965,6 +6965,8 @@ void unmapnotify(struct wl_listener *listener, void *data) {
if (nextfocus) {
focusclient(nextfocus, 0);
if (selmon && is_canvas_layout(selmon))
canvas_pan_to_client(selmon, nextfocus);
}
if (!nextfocus && selmon->isoverview) {
@ -7552,6 +7554,12 @@ void xwaylandready(struct wl_listener *listener, void *data) {
static void setgeometrynotify(struct wl_listener *listener, void *data) {
Client *c = wl_container_of(listener, c, set_geometry);
if (c->mon && is_canvas_layout(c->mon)) {
client_set_size(c, c->geom.width - 2 * c->bw,
c->geom.height - 2 * c->bw);
return;
}
wlr_scene_node_set_position(&c->scene->node, c->surface.xwayland->x,
c->surface.xwayland->y);
motionnotify(0, NULL, 0, 0, 0, 0);