mirror of
https://github.com/swaywm/sway.git
synced 2026-05-01 06:46:25 -04:00
Merge 50350f37b0 into 8cc26130a6
This commit is contained in:
commit
02213e6ef6
1 changed files with 11 additions and 6 deletions
|
|
@ -15,6 +15,8 @@ const float TYPE_INDICATOR_BORDER_THICKNESS = M_PI / 128.0f;
|
||||||
void render_frame(struct swaylock_surface *surface) {
|
void render_frame(struct swaylock_surface *surface) {
|
||||||
struct swaylock_state *state = surface->state;
|
struct swaylock_state *state = surface->state;
|
||||||
|
|
||||||
|
static bool first_render = true;
|
||||||
|
|
||||||
int buffer_width = surface->width * surface->scale;
|
int buffer_width = surface->width * surface->scale;
|
||||||
int buffer_height = surface->height * surface->scale;
|
int buffer_height = surface->height * surface->scale;
|
||||||
if (buffer_width == 0 || buffer_height == 0) {
|
if (buffer_width == 0 || buffer_height == 0) {
|
||||||
|
|
@ -30,12 +32,15 @@ void render_frame(struct swaylock_surface *surface) {
|
||||||
cairo_t *cairo = surface->current_buffer->cairo;
|
cairo_t *cairo = surface->current_buffer->cairo;
|
||||||
cairo_identity_matrix(cairo);
|
cairo_identity_matrix(cairo);
|
||||||
|
|
||||||
if (state->args.mode == BACKGROUND_MODE_SOLID_COLOR || !surface->image) {
|
if (first_render) {
|
||||||
cairo_set_source_u32(cairo, state->args.color);
|
if (state->args.mode == BACKGROUND_MODE_SOLID_COLOR || !surface->image) {
|
||||||
cairo_paint(cairo);
|
cairo_set_source_u32(cairo, state->args.color);
|
||||||
} else {
|
cairo_paint(cairo);
|
||||||
render_background_image(cairo, surface->image,
|
} else {
|
||||||
state->args.mode, buffer_width, buffer_height);
|
render_background_image(cairo, surface->image,
|
||||||
|
state->args.mode, buffer_width, buffer_height);
|
||||||
|
}
|
||||||
|
first_render = false;
|
||||||
}
|
}
|
||||||
cairo_identity_matrix(cairo);
|
cairo_identity_matrix(cairo);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue