mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
cursor: handle button press on layer-surface (issue #41)
This commit is contained in:
parent
97a5695ccb
commit
ee15a5fe56
5 changed files with 74 additions and 22 deletions
15
src/cursor.c
15
src/cursor.c
|
|
@ -303,6 +303,7 @@ cursor_button(struct wl_listener *listener, void *data)
|
|||
struct wlr_surface *surface;
|
||||
int view_area;
|
||||
uint32_t resize_edges;
|
||||
|
||||
struct view *view = desktop_view_at(server, server->seat.cursor->x,
|
||||
server->seat.cursor->y, &surface, &sx, &sy, &view_area);
|
||||
|
||||
|
|
@ -336,9 +337,19 @@ cursor_button(struct wl_listener *listener, void *data)
|
|||
return;
|
||||
}
|
||||
|
||||
/* handle _press_ on desktop */
|
||||
/* Handle _press_ on a layer surface */
|
||||
if (!view && surface) {
|
||||
/* ...if we've ended up here it must be a layer surface */
|
||||
assert(wlr_surface_is_layer_surface(surface));
|
||||
struct wlr_layer_surface_v1 *layer = wlr_layer_surface_v1_from_wlr_surface(surface);
|
||||
if (layer->current.keyboard_interactive) {
|
||||
seat_set_focus_layer(&server->seat, layer);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Handle _press_ on root window */
|
||||
if (!view) {
|
||||
/* launch root-menu */
|
||||
action(server, "ShowMenu", "root-menu");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue