mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-12-18 19:03:18 +00:00
Actually fix the crashing. Also, popups now also work when the parent client isn't master
This commit is contained in:
parent
a2bb0b3bf1
commit
be993d3072
16
dwl.c
16
dwl.c
@ -885,17 +885,15 @@ createnotify(struct wl_listener *listener, void *data)
|
|||||||
* client, either a toplevel (application window) or popup. */
|
* client, either a toplevel (application window) or popup. */
|
||||||
struct wlr_xdg_surface *xdg_surface = data;
|
struct wlr_xdg_surface *xdg_surface = data;
|
||||||
Client *c;
|
Client *c;
|
||||||
Arg tags;
|
|
||||||
Arg oldtags;
|
|
||||||
|
|
||||||
if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
|
if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
|
||||||
Client *sel = selclient();
|
|
||||||
Monitor *selmo = xytomon(cursor->x, cursor->y);
|
Monitor *selmo = xytomon(cursor->x, cursor->y);
|
||||||
|
Client *c = wlr_xdg_surface_from_wlr_surface(xdg_surface->popup->parent)->data;
|
||||||
struct wlr_box pop_box = {
|
struct wlr_box pop_box = {
|
||||||
.x = sel->geom.x - selmo->m.x,
|
.x = 0,
|
||||||
.y = sel->geom.y - selmo->m.y,
|
.y = 0,
|
||||||
.width = sel->geom.width,
|
.width = c->geom.width,
|
||||||
.height = sel->geom.height,
|
.height = c->geom.height,
|
||||||
};
|
};
|
||||||
wlr_xdg_popup_unconstrain_from_box(xdg_surface->popup, &pop_box);
|
wlr_xdg_popup_unconstrain_from_box(xdg_surface->popup, &pop_box);
|
||||||
return;
|
return;
|
||||||
@ -917,10 +915,6 @@ createnotify(struct wl_listener *listener, void *data)
|
|||||||
LISTEN(&xdg_surface->toplevel->events.request_fullscreen, &c->fullscreen,
|
LISTEN(&xdg_surface->toplevel->events.request_fullscreen, &c->fullscreen,
|
||||||
fullscreennotify);
|
fullscreennotify);
|
||||||
c->isfullscreen = 0;
|
c->isfullscreen = 0;
|
||||||
oldtags.ui = c->tags;
|
|
||||||
tags.ui = c->tags;
|
|
||||||
view(&tags);
|
|
||||||
view(&oldtags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user