Replace scaled_rect_buffer with lab_scene_rect

This fixes the gap between menu items and the menu border in an output
with a fractional scale due to the semantic gap between cairo and
wlroots's position-independent scene renderer.
This commit is contained in:
tokyo4j 2025-06-09 16:28:34 +09:00 committed by Hiroaki Yamamoto
parent ffd400503e
commit 97ce4131bb
5 changed files with 32 additions and 169 deletions

View file

@ -1,31 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_SCALED_RECT_BUFFER_H
#define LABWC_SCALED_RECT_BUFFER_H
#include <stdint.h>
struct wlr_scene_tree;
struct wlr_scene_buffer;
struct scaled_scene_buffer;
struct scaled_rect_buffer {
struct wlr_scene_buffer *scene_buffer;
struct scaled_scene_buffer *scaled_buffer;
int width;
int height;
int border_width;
float fill_color[4];
float border_color[4];
};
/*
* Create an auto scaling borderd-rectangle buffer, providing a wlr_scene_buffer
* node for display. It gets destroyed automatically when the backing
* scaled_scene_buffer is being destroyed which in turn happens automatically
* when the backing wlr_scene_buffer (or one of its parents) is being destroyed.
*/
struct scaled_rect_buffer *scaled_rect_buffer_create(
struct wlr_scene_tree *parent, int width, int height, int border_width,
float fill_color[4], float border_color[4]);
#endif /* LABWC_SCALED_RECT_BUFFER_H */