From 527a73120bcdd3e32fc2e36a19a32e45f2c8803d Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sat, 17 Nov 2012 20:13:27 +0100 Subject: [PATCH] seat: allow calling go_foreground if already in foreground If we are asleep and in foreground, go_foreground() should return success so we can safely unload asynchronous sessions. Otherwise, we wouldn't be able to handle them properly while being inactive or we would need a whole bunch of other checks. Signed-off-by: David Herrmann --- src/kmscon_seat.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/kmscon_seat.c b/src/kmscon_seat.c index 884b6b1..85990ca 100644 --- a/src/kmscon_seat.c +++ b/src/kmscon_seat.c @@ -134,11 +134,9 @@ static int seat_go_foreground(struct kmscon_seat *seat) { int ret; - if (!seat->awake) - return -EBUSY; if (seat->foreground) return 0; - if (seat->current_sess) + if (!seat->awake || seat->current_sess) return -EBUSY; if (seat->cb) {