fix: fix surface focuse error when focus_on_activate is 0

This commit is contained in:
DreamMaoMao 2025-05-04 11:12:13 +08:00
parent 09bd681919
commit f56db5deb1

View file

@ -7406,19 +7406,12 @@ void smartresizewin(const Arg *arg) {
void activatex11(struct wl_listener *listener, void *data) {
Client *c = wl_container_of(listener, c, activate);
if (!c || c->iskilling)
if (!c || c->iskilling || !c->foreign_toplevel || client_is_unmanaged(c))
return;
if (c && c->swallowing)
return;
/* Only "managed" windows can be activated */
if (!client_is_unmanaged(c))
wlr_xwayland_surface_activate(c->surface.xwayland, 1);
if (!c || !c->foreign_toplevel)
return;
if (focus_on_activate && c != selmon->sel) {
if (c->isminied) {
c->isminied = 0;
@ -7430,6 +7423,7 @@ void activatex11(struct wl_listener *listener, void *data) {
setborder_color(c);
}
view(&(Arg){.ui = c->tags}, true);
wlr_xwayland_surface_activate(c->surface.xwayland, 1);
focusclient(c, 1);
} else if (c != focustop(selmon)) {
if (client_surface(c)->mapped)