aboutsummaryrefslogtreecommitdiff
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-12-05 16:50:31 +0100
committerSimon Ser <contact@emersion.fr>2023-12-13 10:11:35 +0100
commitc6edbb7e5a3e10b4f86a3bee215de5f4c7021674 (patch)
treec2f14d1031198b293ec0bc60d4fd3b1af560959d /sway/input/seat.c
parente8a02056079a6aa9bead020677667e51fc41a055 (diff)
input/seat: simplify seat_is_input_allowed()
Use an early return to make the code more readable.
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 31c9b72b..cb8ac6a4 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -1092,19 +1092,19 @@ void seat_configure_xcursor(struct sway_seat *seat) {
bool seat_is_input_allowed(struct sway_seat *seat,
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;
- }
- }
+ if (!server.session_lock.locked) {
+ return true;
+ }
+ if (server.session_lock.lock == NULL) {
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) {