do managed check in activatex11

main
Devin J. Pohly 2020-07-25 11:48:47 -04:00
parent e5e170e420
commit f2d025d4e9
1 changed files with 4 additions and 4 deletions

8
dwl.c
View File

@ -281,7 +281,7 @@ activatex11(struct wl_listener *listener, void *data)
{ {
Client *c = wl_container_of(listener, c, activate); Client *c = wl_container_of(listener, c, activate);
if (c && c->isx11) if (c->type == X11Managed)
wlr_xwayland_surface_activate(c->xwayland_surface, 1); wlr_xwayland_surface_activate(c->xwayland_surface, 1);
} }
@ -580,16 +580,16 @@ createnotifyx11(struct wl_listener *listener, void *data)
c->map.notify = maprequest; c->map.notify = maprequest;
c->unmap.notify = unmapnotify; c->unmap.notify = unmapnotify;
/* Only "managed" windows can be activated */ /* Only "managed" windows can be activated */
c->activate.notify = activatex11;
wl_signal_add(&xwayland_surface->events.request_activate, &c->activate);
} else { } else {
c->type = X11Unmanaged; c->type = X11Unmanaged;
c->map.notify = maprequestindependent; c->map.notify = maprequestindependent;
c->unmap.notify = unmapnotifyindependent; c->unmap.notify = unmapnotifyindependent;
} }
c->destroy.notify = destroynotify;
wl_signal_add(&xwayland_surface->events.map, &c->map); wl_signal_add(&xwayland_surface->events.map, &c->map);
wl_signal_add(&xwayland_surface->events.unmap, &c->unmap); wl_signal_add(&xwayland_surface->events.unmap, &c->unmap);
c->activate.notify = activatex11;
wl_signal_add(&xwayland_surface->events.request_activate, &c->activate);
c->destroy.notify = destroynotify;
wl_signal_add(&xwayland_surface->events.destroy, &c->destroy); wl_signal_add(&xwayland_surface->events.destroy, &c->destroy);
} }