mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
Remove src/common/log.c
Use wlr_log() instead
This commit is contained in:
parent
20fd8f59a7
commit
82e47ac1f5
20 changed files with 28 additions and 65 deletions
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef __LABWC_LOG_H
|
||||
#define __LABWC_LOG_H
|
||||
|
||||
/**
|
||||
* warn - print warning
|
||||
*/
|
||||
void warn(const char *err, ...);
|
||||
|
||||
#endif /* __LABWC_LOG_H */
|
||||
|
|
@ -33,8 +33,6 @@
|
|||
#include <wlr/xwayland.h>
|
||||
#endif
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
#include "common/log.h"
|
||||
#include "config/keybind.h"
|
||||
#include "config/rcxml.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#include <strings.h>
|
||||
#include "common/log.h"
|
||||
#include <wlr/util/log.h>
|
||||
#include "common/spawn.h"
|
||||
#include "labwc.h"
|
||||
#include "menu/menu.h"
|
||||
|
|
@ -59,6 +59,6 @@ action(struct server *server, const char *action, const char *command)
|
|||
view_maximize(view, true);
|
||||
}
|
||||
} else {
|
||||
warn("action (%s) not supported", action);
|
||||
wlr_log(WLR_ERROR, "action (%s) not supported", action);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "common/dir.h"
|
||||
#include "common/log.h"
|
||||
|
||||
struct dir {
|
||||
const char *prefix;
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
void
|
||||
warn(const char *err, ...)
|
||||
{
|
||||
va_list params;
|
||||
fprintf(stderr, "[labwc] warn: ");
|
||||
va_start(params, err);
|
||||
vfprintf(stderr, err, params);
|
||||
va_end(params);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
|
|
@ -3,7 +3,6 @@ labwc_sources += files(
|
|||
'dir.c',
|
||||
'font.c',
|
||||
'grab-file.c',
|
||||
'log.c',
|
||||
'nodename.c',
|
||||
'spawn.c',
|
||||
'string-helpers.c',
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include "common/log.h"
|
||||
#include <wlr/util/log.h>
|
||||
#include "common/spawn.h"
|
||||
|
||||
void
|
||||
|
|
@ -35,7 +35,7 @@ spawn_async_no_shell(char const *command)
|
|||
child = fork();
|
||||
switch (child) {
|
||||
case -1:
|
||||
warn("unable to fork()");
|
||||
wlr_log(WLR_ERROR, "unable to fork()");
|
||||
goto out;
|
||||
case 0:
|
||||
setsid();
|
||||
|
|
@ -47,7 +47,7 @@ spawn_async_no_shell(char const *command)
|
|||
execvp(argv[0], argv);
|
||||
_exit(0);
|
||||
} else if (grandchild < 0) {
|
||||
warn("unable to fork()");
|
||||
wlr_log(WLR_ERROR, "unable to fork()");
|
||||
}
|
||||
_exit(0);
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common/log.h"
|
||||
#include <wlr/util/log.h>
|
||||
#include "config/keybind.h"
|
||||
#include "config/rcxml.h"
|
||||
|
||||
|
|
@ -39,7 +38,7 @@ keybind_create(const char *keybind)
|
|||
xkb_keysym_t sym = xkb_keysym_from_name(
|
||||
symname, XKB_KEYSYM_CASE_INSENSITIVE);
|
||||
if (sym == XKB_KEY_NoSymbol) {
|
||||
warn("unknown keybind (%s)", symname);
|
||||
wlr_log(WLR_ERROR, "unknown keybind (%s)", symname);
|
||||
free(k);
|
||||
k = NULL;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
#include <wayland-server-core.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "common/dir.h"
|
||||
#include "common/log.h"
|
||||
#include "common/nodename.h"
|
||||
#include "common/string-helpers.h"
|
||||
#include "common/zfree.h"
|
||||
|
|
@ -227,7 +226,7 @@ rcxml_parse_xml(struct buf *b)
|
|||
{
|
||||
xmlDoc *d = xmlParseMemory(b->buf, b->len);
|
||||
if (!d) {
|
||||
warn("xmlParseMemory()");
|
||||
wlr_log(WLR_ERROR, "xmlParseMemory()");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
xml_tree_walk(xmlDocGetRootElement(d));
|
||||
|
|
@ -330,7 +329,7 @@ rcxml_read(const char *filename)
|
|||
/* Reading file into buffer before parsing - better for unit tests */
|
||||
stream = fopen(rcxml, "r");
|
||||
if (!stream) {
|
||||
warn("cannot read (%s)", rcxml);
|
||||
wlr_log(WLR_ERROR, "cannot read (%s)", rcxml);
|
||||
goto no_config;
|
||||
}
|
||||
wlr_log(WLR_INFO, "read config file %s", rcxml);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#include <sys/stat.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "common/dir.h"
|
||||
#include "common/log.h"
|
||||
#include "common/spawn.h"
|
||||
#include "common/string-helpers.h"
|
||||
|
||||
|
|
@ -99,7 +98,7 @@ session_autostart_init(void)
|
|||
return;
|
||||
}
|
||||
if (!isfile(autostart)) {
|
||||
warn("no autostart file");
|
||||
wlr_log(WLR_ERROR, "no autostart file");
|
||||
goto out;
|
||||
}
|
||||
wlr_log(WLR_INFO, "run autostart file %s", autostart);
|
||||
|
|
|
|||
|
|
@ -75,12 +75,11 @@ static void
|
|||
process_cursor_move(struct server *server, uint32_t time)
|
||||
{
|
||||
damage_all_outputs(server);
|
||||
/* Move the grabbed view to the new position. */
|
||||
double dx = server->seat.cursor->x - server->grab_x;
|
||||
double dy = server->seat.cursor->y - server->grab_y;
|
||||
|
||||
struct view *view = server->grabbed_view;
|
||||
assert(view);
|
||||
|
||||
/* Move the grabbed view to the new position. */
|
||||
view->impl->move(view, server->grab_box.x + dx, server->grab_box.y + dy);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#include <wlr/backend/multi.h>
|
||||
#include <wlr/backend/session.h>
|
||||
#include "common/log.h"
|
||||
#include "labwc.h"
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <string.h>
|
||||
#include <wayland-server.h>
|
||||
#include <wlr/types/wlr_layer_shell_v1.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "layers.h"
|
||||
#include "labwc.h"
|
||||
|
||||
|
|
@ -149,7 +150,7 @@ arrange_layer(struct wlr_output *output, struct wl_list *list,
|
|||
box.y -= state->margin.bottom;
|
||||
}
|
||||
if (box.width < 0 || box.height < 0) {
|
||||
warn("protocol error");
|
||||
wlr_log(WLR_ERROR, "protocol error");
|
||||
wlr_layer_surface_v1_close(layer);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include "common/font.h"
|
||||
#include "common/log.h"
|
||||
#include "common/spawn.h"
|
||||
#include "config/session.h"
|
||||
#include "labwc.h"
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ parse_xml(const char *filename, struct menu *menu)
|
|||
|
||||
stream = fopen(menuxml, "r");
|
||||
if (!stream) {
|
||||
warn("cannot read (%s)", menuxml);
|
||||
wlr_log(WLR_ERROR, "cannot read %s", menuxml);
|
||||
return;
|
||||
}
|
||||
wlr_log(WLR_INFO, "read menu file %s", menuxml);
|
||||
|
|
@ -222,7 +222,7 @@ parse_xml(const char *filename, struct menu *menu)
|
|||
fclose(stream);
|
||||
xmlDoc *d = xmlParseMemory(b.buf, b.len);
|
||||
if (!d) {
|
||||
warn("xmlParseMemory()");
|
||||
wlr_log(WLR_ERROR, "xmlParseMemory()");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
xml_tree_walk(xmlDocGetRootElement(d), menu);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#include "config.h"
|
||||
#include "common/log.h"
|
||||
#include <wlr/util/log.h>
|
||||
#include "config/keybind.h"
|
||||
#include "config/rcxml.h"
|
||||
#include "labwc.h"
|
||||
|
|
@ -12,7 +12,7 @@ xwl_nr_parents(struct view *view)
|
|||
int i = 0;
|
||||
|
||||
if (!s) {
|
||||
warn("(%s) no xwayland surface\n", __func__);
|
||||
wlr_log(WLR_ERROR, "no xwayland surface");
|
||||
return -1;
|
||||
}
|
||||
while (s->parent) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include <wlr/types/wlr_xdg_output_v1.h>
|
||||
#include <wlr/types/wlr_output_damage.h>
|
||||
#include <wlr/util/region.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "labwc.h"
|
||||
#include "layers.h"
|
||||
#include "menu/menu.h"
|
||||
|
|
@ -936,7 +937,7 @@ static struct wlr_output_configuration_v1 *create_output_config(struct server *s
|
|||
{
|
||||
struct wlr_output_configuration_v1 *config = wlr_output_configuration_v1_create();
|
||||
if(config == NULL) {
|
||||
warn("wlr_output_configuration_v1_create() returned NULL");
|
||||
wlr_log(WLR_ERROR, "wlr_output_configuration_v1_create()");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -946,7 +947,7 @@ static struct wlr_output_configuration_v1 *create_output_config(struct server *s
|
|||
wlr_output_configuration_head_v1_create(config,
|
||||
output->wlr_output);
|
||||
if (head == NULL) {
|
||||
warn("wlr_output_configuration_head_v1_create() returned NULL");
|
||||
wlr_log(WLR_ERROR, "wlr_output_configuration_head_v1_create()");
|
||||
wlr_output_configuration_v1_destroy(config);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -956,7 +957,7 @@ static struct wlr_output_configuration_v1 *create_output_config(struct server *s
|
|||
head->state.x = box->x;
|
||||
head->state.y = box->y;
|
||||
} else {
|
||||
warn("%s: failed to get box for output", __func__);
|
||||
wlr_log(WLR_ERROR, "failed to get output layout box");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -972,7 +973,7 @@ static void handle_output_layout_change(struct wl_listener *listener, void *data
|
|||
if(config != NULL) {
|
||||
wlr_output_manager_v1_set_configuration(server->output_manager, config);
|
||||
} else {
|
||||
warn("wlr_output_manager_v1_set_configuration returned NULL");
|
||||
wlr_log(WLR_ERROR, "wlr_output_manager_v1_set_configuration()");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@ configure_libinput(struct wlr_input_device *wlr_input_device)
|
|||
* for the time being, lets just enable tap.
|
||||
*/
|
||||
if (!wlr_input_device) {
|
||||
warn("%s:%d: no wlr_input_device", __FILE__, __LINE__);
|
||||
wlr_log(WLR_ERROR, "no wlr_input_device");
|
||||
return;
|
||||
}
|
||||
struct libinput_device *libinput_dev =
|
||||
wlr_libinput_get_device_handle(wlr_input_device);
|
||||
if (!libinput_dev) {
|
||||
warn("%s:%d: no libinput_dev", __FILE__, __LINE__);
|
||||
wlr_log(WLR_ERROR, "no libinput_dev");
|
||||
return;
|
||||
}
|
||||
if (libinput_device_config_tap_get_finger_count(libinput_dev) <= 0) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#include <wlr/types/wlr_gamma_control_v1.h>
|
||||
#include <wlr/types/wlr_primary_selection_v1.h>
|
||||
#include <wlr/types/wlr_screencopy_v1.h>
|
||||
#include "common/log.h"
|
||||
#include "config/rcxml.h"
|
||||
#include "labwc.h"
|
||||
#include "layers.h"
|
||||
|
|
|
|||
|
|
@ -16,10 +16,8 @@
|
|||
#include <string.h>
|
||||
#include <wlr/util/box.h>
|
||||
#include <wlr/util/log.h>
|
||||
|
||||
#include "common/dir.h"
|
||||
#include "common/font.h"
|
||||
#include "common/log.h"
|
||||
#include "common/string-helpers.h"
|
||||
#include "common/zfree.h"
|
||||
#include "config/rcxml.h"
|
||||
|
|
@ -266,7 +264,7 @@ rounded_rect(struct wlr_renderer *renderer, struct rounded_corner_ctx *ctx)
|
|||
cairo_line_to(cairo, 0, 0);
|
||||
break;
|
||||
default:
|
||||
warn("unknown corner type");
|
||||
wlr_log(WLR_ERROR, "unknown corner type");
|
||||
}
|
||||
cairo_close_path(cairo);
|
||||
cairo_set_operator(cairo, CAIRO_OPERATOR_SOURCE);
|
||||
|
|
@ -293,7 +291,7 @@ rounded_rect(struct wlr_renderer *renderer, struct rounded_corner_ctx *ctx)
|
|||
cairo_line_to(cairo, w - half_line_width, h);
|
||||
break;
|
||||
default:
|
||||
warn("unknown corner type");
|
||||
wlr_log(WLR_ERROR, "unknown corner type");
|
||||
}
|
||||
cairo_stroke(cairo);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue