mirror of
https://github.com/swaywm/sway.git
synced 2026-04-20 06:47:03 -04:00
Don't ignore initialisation errors
server_init ignores all errors. In practice, theses result in a segfault, potentially much later and losing any unsaved work. Properly handle initialisation errors and bail immediately.
This commit is contained in:
parent
909a2ddb5f
commit
fc13bd2f77
5 changed files with 222 additions and 23 deletions
|
|
@ -344,8 +344,12 @@ bool sway_session_lock_has_surface(struct sway_session_lock *lock,
|
|||
return false;
|
||||
}
|
||||
|
||||
void sway_session_lock_init(void) {
|
||||
bool sway_session_lock_init(void) {
|
||||
server.session_lock.manager = wlr_session_lock_manager_v1_create(server.wl_display);
|
||||
if (!server.session_lock.manager) {
|
||||
sway_log(SWAY_ERROR, "Failed to create session lock manager");
|
||||
return false;
|
||||
}
|
||||
|
||||
server.session_lock.new_lock.notify = handle_session_lock;
|
||||
server.session_lock.manager_destroy.notify = handle_session_lock_destroy;
|
||||
|
|
@ -353,4 +357,5 @@ void sway_session_lock_init(void) {
|
|||
&server.session_lock.new_lock);
|
||||
wl_signal_add(&server.session_lock.manager->events.destroy,
|
||||
&server.session_lock.manager_destroy);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue