mirror of
https://github.com/NickHu/sway
synced 2024-12-26 21:58:30 +01:00
Fix pointer events for ext-session-lock surfaces
We were never sending any pointer event to ext-session-lock surfaces.
This commit is contained in:
parent
d5b69d5912
commit
6a3e265326
2 changed files with 31 additions and 2 deletions
|
@ -97,6 +97,24 @@ struct sway_node *node_at_coords(
|
||||||
double ox = lx, oy = ly;
|
double ox = lx, oy = ly;
|
||||||
wlr_output_layout_output_coords(root->output_layout, wlr_output, &ox, &oy);
|
wlr_output_layout_output_coords(root->output_layout, wlr_output, &ox, &oy);
|
||||||
|
|
||||||
|
if (server.session_lock.locked) {
|
||||||
|
if (server.session_lock.lock == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
struct wlr_session_lock_surface_v1 *lock_surf;
|
||||||
|
wl_list_for_each(lock_surf, &server.session_lock.lock->surfaces, link) {
|
||||||
|
if (lock_surf->output != wlr_output) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
*surface = wlr_surface_surface_at(lock_surf->surface, ox, oy, sx, sy);
|
||||||
|
if (*surface != NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// layer surfaces on the overlay layer are rendered on top
|
// layer surfaces on the overlay layer are rendered on top
|
||||||
if ((*surface = layer_surface_at(output,
|
if ((*surface = layer_surface_at(output,
|
||||||
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY],
|
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY],
|
||||||
|
|
|
@ -1089,9 +1089,20 @@ void seat_configure_xcursor(struct sway_seat *seat) {
|
||||||
|
|
||||||
bool seat_is_input_allowed(struct sway_seat *seat,
|
bool seat_is_input_allowed(struct sway_seat *seat,
|
||||||
struct wlr_surface *surface) {
|
struct wlr_surface *surface) {
|
||||||
|
if (server.session_lock.locked) {
|
||||||
|
if (server.session_lock.lock == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
struct wlr_session_lock_surface_v1 *lock_surf;
|
||||||
|
wl_list_for_each(lock_surf, &server.session_lock.lock->surfaces, link) {
|
||||||
|
if (lock_surf->surface == surface) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
struct wl_client *client = wl_resource_get_client(surface->resource);
|
struct wl_client *client = wl_resource_get_client(surface->resource);
|
||||||
return seat->exclusive_client == client ||
|
return seat->exclusive_client == client || seat->exclusive_client == NULL;
|
||||||
(seat->exclusive_client == NULL && !server.session_lock.locked);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void send_unfocus(struct sway_container *con, void *data) {
|
static void send_unfocus(struct sway_container *con, void *data) {
|
||||||
|
|
Loading…
Reference in a new issue