/* * Cagebreak: A Wayland tiling compositor. * * Copyright (C) 2020 The Cagebreak Authors * Copyright (C) 2018-2019 Jente Hidskes * * See the LICENSE file accompanying this file. */ #define _POSIX_C_SOURCE 200809L #include #include #include #include #include #include #include #include "output.h" #include "seat.h" #include "server.h" #include "view.h" #include "workspace.h" #include "xdg_shell.h" #if CG_HAS_XWAYLAND #include "xwayland.h" #endif void display_terminate(struct cg_server *server) { if(server == NULL) { return; } server->running = false; wl_display_terminate(server->wl_display); } /* Returns the index of a mode given its name or "-1" if the mode is not found. */ int get_mode_index_from_name(char *const *modes, const char *mode_name) { for(int i = 0; modes[i] != NULL; ++i) { if(strcmp(modes[i], mode_name) == 0) { return i; } } return -1; }