+++ /dev/null
-#ifndef __LABWC_LOG_H
-#define __LABWC_LOG_H
-
-/**
- * warn - print warning
- */
-void warn(const char *err, ...);
-
-#endif /* __LABWC_LOG_H */
#include <wlr/xwayland.h>
#endif
#include <xkbcommon/xkbcommon.h>
-
-#include "common/log.h"
#include "config/keybind.h"
#include "config/rcxml.h"
#include <strings.h>
-#include "common/log.h"
+#include <wlr/util/log.h>
#include "common/spawn.h"
#include "labwc.h"
#include "menu/menu.h"
view_maximize(view, true);
}
} else {
- warn("action (%s) not supported", action);
+ wlr_log(WLR_ERROR, "action (%s) not supported", action);
}
}
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
-
#include "common/dir.h"
-#include "common/log.h"
struct dir {
const char *prefix;
+++ /dev/null
-#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");
-}
-
'dir.c',
'font.c',
'grab-file.c',
- 'log.c',
'nodename.c',
'spawn.c',
'string-helpers.c',
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>
-#include "common/log.h"
+#include <wlr/util/log.h>
#include "common/spawn.h"
void
child = fork();
switch (child) {
case -1:
- warn("unable to fork()");
+ wlr_log(WLR_ERROR, "unable to fork()");
goto out;
case 0:
setsid();
execvp(argv[0], argv);
_exit(0);
} else if (grandchild < 0) {
- warn("unable to fork()");
+ wlr_log(WLR_ERROR, "unable to fork()");
}
_exit(0);
default:
#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"
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;
#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"
{
xmlDoc *d = xmlParseMemory(b->buf, b->len);
if (!d) {
- warn("xmlParseMemory()");
+ wlr_log(WLR_ERROR, "xmlParseMemory()");
exit(EXIT_FAILURE);
}
xml_tree_walk(xmlDocGetRootElement(d));
/* 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);
#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"
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);
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);
}
#include <wlr/backend/multi.h>
#include <wlr/backend/session.h>
-#include "common/log.h"
#include "labwc.h"
static void
#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"
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;
}
#include "common/font.h"
-#include "common/log.h"
#include "common/spawn.h"
#include "config/session.h"
#include "labwc.h"
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);
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);
#include "config.h"
-#include "common/log.h"
+#include <wlr/util/log.h>
#include "config/keybind.h"
#include "config/rcxml.h"
#include "labwc.h"
int i = 0;
if (!s) {
- warn("(%s) no xwayland surface\n", __func__);
+ wlr_log(WLR_ERROR, "no xwayland surface");
return -1;
}
while (s->parent) {
#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"
{
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;
}
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;
}
struct wlr_box *box = wlr_output_layout_get_box(server->output_layout,
output->wlr_output);
- if(box != NULL) {
+ if (box != NULL) {
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");
}
}
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()");
}
}
}
* 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) {
#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"
#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"
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);
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);