mirror of
https://github.com/swaywm/sway.git
synced 2024-11-10 20:44:01 +01:00
input/seat: simplify seat_is_input_allowed()
Use an early return to make the code more readable.
This commit is contained in:
parent
e8a0205607
commit
c6edbb7e5a
@ -1092,19 +1092,19 @@ 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.locked) {
|
||||||
if (server.session_lock.lock == NULL) {
|
return true;
|
||||||
return false;
|
}
|
||||||
}
|
if (server.session_lock.lock == NULL) {
|
||||||
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;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void send_unfocus(struct sway_container *con, void *data) {
|
static void send_unfocus(struct sway_container *con, void *data) {
|
||||||
|
Loading…
Reference in New Issue
Block a user