mirror of
https://github.com/labwc/labwc.git
synced 2026-04-07 08:21:20 -04:00
desktop: let get_cursor_context() return layer-popup subsurface
With this change, when a layer-popup has a subsurface and cursor is on it, wl_pointer.enter/motion events are sent to the subsurface rather than its parent layer-popup surface. I think this follows wayland spec more closely. Tested with my demo: https://github.com/tokyo4j/wayland-demo/tree/layer-popup
This commit is contained in:
parent
3d670b772d
commit
3a3b873d0e
1 changed files with 1 additions and 22 deletions
|
|
@ -242,23 +242,6 @@ desktop_update_top_layer_visibility(struct server *server)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct wlr_surface *
|
|
||||||
get_surface_from_layer_node(struct wlr_scene_node *node)
|
|
||||||
{
|
|
||||||
assert(node->data);
|
|
||||||
struct node_descriptor *desc = (struct node_descriptor *)node->data;
|
|
||||||
if (desc->type == LAB_NODE_LAYER_SURFACE) {
|
|
||||||
struct lab_layer_surface *surface;
|
|
||||||
surface = node_layer_surface_from_node(node);
|
|
||||||
return surface->scene_layer_surface->layer_surface->surface;
|
|
||||||
} else if (desc->type == LAB_NODE_LAYER_POPUP) {
|
|
||||||
struct lab_layer_popup *popup;
|
|
||||||
popup = node_layer_popup_from_node(node);
|
|
||||||
return popup->wlr_popup->base->surface;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* TODO: make this less big and scary */
|
/* TODO: make this less big and scary */
|
||||||
struct cursor_context
|
struct cursor_context
|
||||||
get_cursor_context(struct server *server)
|
get_cursor_context(struct server *server)
|
||||||
|
|
@ -315,11 +298,7 @@ get_cursor_context(struct server *server)
|
||||||
ret.surface = lab_wlr_surface_from_node(ret.node);
|
ret.surface = lab_wlr_surface_from_node(ret.node);
|
||||||
return ret;
|
return ret;
|
||||||
case LAB_NODE_LAYER_POPUP:
|
case LAB_NODE_LAYER_POPUP:
|
||||||
ret.node = node;
|
case LAB_NODE_SESSION_LOCK_SURFACE:
|
||||||
ret.type = LAB_NODE_CLIENT;
|
|
||||||
ret.surface = get_surface_from_layer_node(node);
|
|
||||||
return ret;
|
|
||||||
case LAB_NODE_SESSION_LOCK_SURFACE: /* fallthrough */
|
|
||||||
case LAB_NODE_IME_POPUP:
|
case LAB_NODE_IME_POPUP:
|
||||||
ret.type = LAB_NODE_CLIENT;
|
ret.type = LAB_NODE_CLIENT;
|
||||||
ret.surface = lab_wlr_surface_from_node(ret.node);
|
ret.surface = lab_wlr_surface_from_node(ret.node);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue