mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Handle wlc log events
This commit is contained in:
parent
1e18ba9f2d
commit
ac2034df99
2 changed files with 12 additions and 1 deletions
|
@ -498,7 +498,6 @@ static void handle_wlc_ready(void) {
|
||||||
config->active = true;
|
config->active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct wlc_interface interface = {
|
struct wlc_interface interface = {
|
||||||
.output = {
|
.output = {
|
||||||
.created = handle_output_created,
|
.created = handle_output_created,
|
||||||
|
|
12
sway/main.c
12
sway/main.c
|
@ -21,6 +21,16 @@ void sway_terminate(void) {
|
||||||
|
|
||||||
static void sigchld_handle(int signal);
|
static void sigchld_handle(int signal);
|
||||||
|
|
||||||
|
static void wlc_log_handler(enum wlc_log_type type, const char *str) {
|
||||||
|
if (type == WLC_LOG_ERROR) {
|
||||||
|
sway_log(L_ERROR, "%s", str);
|
||||||
|
} else if (type == WLC_LOG_WARN) {
|
||||||
|
sway_log(L_INFO, "%s", str);
|
||||||
|
} else {
|
||||||
|
sway_log(L_DEBUG, "%s", str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
static int verbose = 0, debug = 0, validate = 0;
|
static int verbose = 0, debug = 0, validate = 0;
|
||||||
|
|
||||||
|
@ -38,6 +48,8 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
setenv("WLC_DIM", "0", 0);
|
setenv("WLC_DIM", "0", 0);
|
||||||
|
|
||||||
|
wlc_log_set_handler(wlc_log_handler);
|
||||||
|
|
||||||
/* Changing code earlier than this point requires detailed review */
|
/* Changing code earlier than this point requires detailed review */
|
||||||
if (!wlc_init(&interface, argc, argv)) {
|
if (!wlc_init(&interface, argc, argv)) {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in a new issue