mirror of
https://cagebreak.project-repo.co/cagebreak.git
synced 2026-08-23 05:54:19 +02:00
Release 1.0.0
- Add basic tiling compositor functionality
This commit is contained in:
commit
de6c07ca2a
45 changed files with 6864 additions and 0 deletions
49
server.c
Normal file
49
server.c
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* 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 <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/types/wlr_box.h>
|
||||
#include <wlr/types/wlr_output.h>
|
||||
#include <wlr/types/wlr_surface.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue