From 39107afa7eebf5f1f2e79fa1acfafdc1e8ca6547 Mon Sep 17 00:00:00 2001 From: Echo J Date: Sun, 13 Nov 2022 12:10:28 +0200 Subject: [PATCH] Fix color format definitions Fixes #4 and #5 based on my own testing I don't know how no one noticed this mistake, but oh well BTW I initially noticed this when trying @adlocode's fork of Hopalong for Xfce Wayland experiments :frog: --- src/compositor/hopalong-view.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/compositor/hopalong-view.c b/src/compositor/hopalong-view.c index c031f67..5297e2d 100644 --- a/src/compositor/hopalong-view.c +++ b/src/compositor/hopalong-view.c @@ -13,6 +13,7 @@ #include #include +#include #include "hopalong-server.h" #include "hopalong-view.h" @@ -44,7 +45,7 @@ generate_minimize_texture(struct hopalong_output *output, const float color[4]) unsigned char *data = cairo_image_surface_get_data(surface); struct wlr_renderer *renderer = output->wlr_output->renderer; struct wlr_texture *texture = wlr_texture_from_pixels(renderer, - WL_SHM_FORMAT_ARGB8888, + DRM_FORMAT_ARGB8888, cairo_image_surface_get_stride(surface), 32, 32, data); @@ -81,7 +82,7 @@ generate_maximize_texture(struct hopalong_output *output, const float color[4]) unsigned char *data = cairo_image_surface_get_data(surface); struct wlr_renderer *renderer = output->wlr_output->renderer; struct wlr_texture *texture = wlr_texture_from_pixels(renderer, - WL_SHM_FORMAT_ARGB8888, + DRM_FORMAT_ARGB8888, cairo_image_surface_get_stride(surface), 32, 32, data); @@ -118,7 +119,7 @@ generate_close_texture(struct hopalong_output *output, const float color[4]) unsigned char *data = cairo_image_surface_get_data(surface); struct wlr_renderer *renderer = output->wlr_output->renderer; struct wlr_texture *texture = wlr_texture_from_pixels(renderer, - WL_SHM_FORMAT_ARGB8888, + DRM_FORMAT_ARGB8888, cairo_image_surface_get_stride(surface), 32, 32, data); @@ -207,7 +208,7 @@ hopalong_view_generate_title_texture(struct hopalong_output *output, struct hopa unsigned char *data = cairo_image_surface_get_data(surface); view->title = wlr_texture_from_pixels(renderer, - WL_SHM_FORMAT_ARGB8888, + DRM_FORMAT_ARGB8888, cairo_image_surface_get_stride(surface), w, h, data); @@ -220,7 +221,7 @@ hopalong_view_generate_title_texture(struct hopalong_output *output, struct hopa data = cairo_image_surface_get_data(surface); view->title_inactive = wlr_texture_from_pixels(renderer, - WL_SHM_FORMAT_ARGB8888, + DRM_FORMAT_ARGB8888, cairo_image_surface_get_stride(surface), w, h, data);