mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-03 06:46:38 -04:00
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:
parent
b509004f4a
commit
601b8cffcf
2 changed files with 14 additions and 0 deletions
|
|
@ -195,6 +195,12 @@ static void canvas_reposition(Monitor *m) {
|
||||||
|
|
||||||
wlr_scene_node_set_position(&c->scene->node, new_x, new_y);
|
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);
|
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, NULL);
|
||||||
client_apply_clip(c, 1.0);
|
client_apply_clip(c, 1.0);
|
||||||
if (zoom != 1.0f && !c->is_clip_to_hide)
|
if (zoom != 1.0f && !c->is_clip_to_hide)
|
||||||
|
|
|
||||||
|
|
@ -6965,6 +6965,8 @@ void unmapnotify(struct wl_listener *listener, void *data) {
|
||||||
|
|
||||||
if (nextfocus) {
|
if (nextfocus) {
|
||||||
focusclient(nextfocus, 0);
|
focusclient(nextfocus, 0);
|
||||||
|
if (selmon && is_canvas_layout(selmon))
|
||||||
|
canvas_pan_to_client(selmon, nextfocus);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nextfocus && selmon->isoverview) {
|
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) {
|
static void setgeometrynotify(struct wl_listener *listener, void *data) {
|
||||||
Client *c = wl_container_of(listener, c, set_geometry);
|
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,
|
wlr_scene_node_set_position(&c->scene->node, c->surface.xwayland->x,
|
||||||
c->surface.xwayland->y);
|
c->surface.xwayland->y);
|
||||||
motionnotify(0, NULL, 0, 0, 0, 0);
|
motionnotify(0, NULL, 0, 0, 0, 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue