mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-12-18 19:03:18 +00:00
fix popups appearing in wrong position
This commit is contained in:
parent
9ff28360f6
commit
f4c656073a
32
dwl.c
32
dwl.c
@ -253,7 +253,6 @@ static void motionabsolute(struct wl_listener *listener, void *data);
|
|||||||
static void motionnotify(uint32_t time);
|
static void motionnotify(uint32_t time);
|
||||||
static void motionrelative(struct wl_listener *listener, void *data);
|
static void motionrelative(struct wl_listener *listener, void *data);
|
||||||
static void moveresize(const Arg *arg);
|
static void moveresize(const Arg *arg);
|
||||||
static Client *popupgetclient(struct wlr_xdg_popup *popup);
|
|
||||||
static void outputmgrapply(struct wl_listener *listener, void *data);
|
static void outputmgrapply(struct wl_listener *listener, void *data);
|
||||||
static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test);
|
static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test);
|
||||||
static void outputmgrtest(struct wl_listener *listener, void *data);
|
static void outputmgrtest(struct wl_listener *listener, void *data);
|
||||||
@ -878,11 +877,8 @@ createnotify(struct wl_listener *listener, void *data)
|
|||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
|
if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
|
||||||
if (!(c = popupgetclient(xdg_surface->popup)))
|
xdg_surface->surface->data = wlr_scene_xdg_popup_create(
|
||||||
return;
|
xdg_surface->popup->parent->data, xdg_surface->popup);
|
||||||
|
|
||||||
wlr_scene_xdg_popup_create(c->scene_surface, xdg_surface->popup);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_NONE)
|
} else if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_NONE)
|
||||||
return;
|
return;
|
||||||
@ -1308,7 +1304,8 @@ mapnotify(struct wl_listener *listener, void *data)
|
|||||||
|
|
||||||
/* Create scene tree for this client and its border */
|
/* Create scene tree for this client and its border */
|
||||||
c->scene = &wlr_scene_tree_create(layers[LyrTile])->node;
|
c->scene = &wlr_scene_tree_create(layers[LyrTile])->node;
|
||||||
c->scene_surface = wlr_scene_subsurface_tree_create(c->scene, client_surface(c));
|
c->scene_surface = client_surface(c)->data =
|
||||||
|
wlr_scene_subsurface_tree_create(c->scene, client_surface(c));
|
||||||
c->scene_surface->data = c;
|
c->scene_surface->data = c;
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
c->border[i] = wlr_scene_rect_create(c->scene, 0, 0, bordercolor);
|
c->border[i] = wlr_scene_rect_create(c->scene, 0, 0, bordercolor);
|
||||||
@ -1453,27 +1450,6 @@ moveresize(const Arg *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *
|
|
||||||
popupgetclient(struct wlr_xdg_popup *popup)
|
|
||||||
{
|
|
||||||
struct wlr_xdg_surface *surface = popup->base;
|
|
||||||
|
|
||||||
while (true) {
|
|
||||||
switch (surface->role) {
|
|
||||||
case WLR_XDG_SURFACE_ROLE_POPUP:
|
|
||||||
if (!wlr_surface_is_xdg_surface(surface->popup->parent)) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
surface = wlr_xdg_surface_from_wlr_surface(surface->popup->parent);
|
|
||||||
break;
|
|
||||||
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
|
||||||
return surface->data;
|
|
||||||
case WLR_XDG_SURFACE_ROLE_NONE:
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
outputmgrapply(struct wl_listener *listener, void *data)
|
outputmgrapply(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user