aboutsummaryrefslogtreecommitdiffstats
path: root/common/background-image.c
diff options
context:
space:
mode:
authorLibravatar M Stoeckl <code@mstoeckl.com>2019-01-20 13:51:12 -0500
committerLibravatar emersion <contact@emersion.fr>2019-01-21 12:59:42 +0100
commit1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 (patch)
tree5c3f60e0219cb8b4a1b7cafb760a871661866e32 /common/background-image.c
parentLog libinput_config_status errors (diff)
downloadsway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.gz
sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.zst
sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.zip
Replace wlr_log with sway_log
This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
Diffstat (limited to 'common/background-image.c')
-rw-r--r--common/background-image.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/background-image.c b/common/background-image.c
index 72f39a79..d15c2989 100644
--- a/common/background-image.c
+++ b/common/background-image.c
@@ -1,8 +1,8 @@
1#include <assert.h> 1#include <assert.h>
2#include <stdbool.h> 2#include <stdbool.h>
3#include <wlr/util/log.h>
4#include "background-image.h" 3#include "background-image.h"
5#include "cairo.h" 4#include "cairo.h"
5#include "log.h"
6 6
7enum background_mode parse_background_mode(const char *mode) { 7enum background_mode parse_background_mode(const char *mode) {
8 if (strcmp(mode, "stretch") == 0) { 8 if (strcmp(mode, "stretch") == 0) {
@@ -18,7 +18,7 @@ enum background_mode parse_background_mode(const char *mode) {
18 } else if (strcmp(mode, "solid_color") == 0) { 18 } else if (strcmp(mode, "solid_color") == 0) {
19 return BACKGROUND_MODE_SOLID_COLOR; 19 return BACKGROUND_MODE_SOLID_COLOR;
20 } 20 }
21 wlr_log(WLR_ERROR, "Unsupported background mode: %s", mode); 21 sway_log(SWAY_ERROR, "Unsupported background mode: %s", mode);
22 return BACKGROUND_MODE_INVALID; 22 return BACKGROUND_MODE_INVALID;
23} 23}
24 24
@@ -28,7 +28,7 @@ cairo_surface_t *load_background_image(const char *path) {
28 GError *err = NULL; 28 GError *err = NULL;
29 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(path, &err); 29 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(path, &err);
30 if (!pixbuf) { 30 if (!pixbuf) {
31 wlr_log(WLR_ERROR, "Failed to load background image (%s).", 31 sway_log(SWAY_ERROR, "Failed to load background image (%s).",
32 err->message); 32 err->message);
33 return false; 33 return false;
34 } 34 }
@@ -38,11 +38,11 @@ cairo_surface_t *load_background_image(const char *path) {
38 image = cairo_image_surface_create_from_png(path); 38 image = cairo_image_surface_create_from_png(path);
39#endif // HAVE_GDK_PIXBUF 39#endif // HAVE_GDK_PIXBUF
40 if (!image) { 40 if (!image) {
41 wlr_log(WLR_ERROR, "Failed to read background image."); 41 sway_log(SWAY_ERROR, "Failed to read background image.");
42 return NULL; 42 return NULL;
43 } 43 }
44 if (cairo_surface_status(image) != CAIRO_STATUS_SUCCESS) { 44 if (cairo_surface_status(image) != CAIRO_STATUS_SUCCESS) {
45 wlr_log(WLR_ERROR, "Failed to read background image: %s." 45 sway_log(SWAY_ERROR, "Failed to read background image: %s."
46#if !HAVE_GDK_PIXBUF 46#if !HAVE_GDK_PIXBUF
47 "\nSway was compiled without gdk_pixbuf support, so only" 47 "\nSway was compiled without gdk_pixbuf support, so only"
48 "\nPNG images can be loaded. This is the likely cause." 48 "\nPNG images can be loaded. This is the likely cause."