2018-04-03 14:04:31 -05:00
|
|
|
#include <math.h>
|
2018-04-03 21:01:29 -05:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <wayland-client.h>
|
2018-04-03 13:31:30 -05:00
|
|
|
#include "cairo.h"
|
|
|
|
#include "background-image.h"
|
2019-01-13 20:15:32 -06:00
|
|
|
#include "swaylock.h"
|
2023-03-12 15:48:58 -05:00
|
|
|
#include "log.h"
|
2018-04-03 13:31:30 -05:00
|
|
|
|
2018-04-03 14:04:31 -05:00
|
|
|
#define M_PI 3.14159265358979323846
|
2018-04-04 17:52:44 -05:00
|
|
|
const float TYPE_INDICATOR_RANGE = M_PI / 3.0f;
|
|
|
|
const float TYPE_INDICATOR_BORDER_THICKNESS = M_PI / 128.0f;
|
2018-04-03 14:04:31 -05:00
|
|
|
|
2018-07-10 20:29:15 -05:00
|
|
|
static void set_color_for_state(cairo_t *cairo, struct swaylock_state *state,
|
|
|
|
struct swaylock_colorset *colorset) {
|
2023-05-02 20:00:41 -05:00
|
|
|
if (state->input_state == INPUT_STATE_CLEAR) {
|
|
|
|
cairo_set_source_u32(cairo, colorset->cleared);
|
|
|
|
} else if (state->auth_state == AUTH_STATE_VALIDATING) {
|
2018-07-10 20:29:15 -05:00
|
|
|
cairo_set_source_u32(cairo, colorset->verifying);
|
|
|
|
} else if (state->auth_state == AUTH_STATE_INVALID) {
|
|
|
|
cairo_set_source_u32(cairo, colorset->wrong);
|
|
|
|
} else {
|
2019-01-14 09:51:04 -06:00
|
|
|
if (state->xkb.caps_lock && state->args.show_caps_lock_indicator) {
|
|
|
|
cairo_set_source_u32(cairo, colorset->caps_lock);
|
|
|
|
} else if (state->xkb.caps_lock && !state->args.show_caps_lock_indicator &&
|
|
|
|
state->args.show_caps_lock_text) {
|
|
|
|
uint32_t inputtextcolor = state->args.colors.text.input;
|
|
|
|
state->args.colors.text.input = state->args.colors.text.caps_lock;
|
|
|
|
cairo_set_source_u32(cairo, colorset->input);
|
|
|
|
state->args.colors.text.input = inputtextcolor;
|
|
|
|
} else {
|
|
|
|
cairo_set_source_u32(cairo, colorset->input);
|
|
|
|
}
|
2018-07-10 20:29:15 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-12 05:16:33 -05:00
|
|
|
void render_frame_background(struct swaylock_surface *surface) {
|
2018-04-03 13:31:30 -05:00
|
|
|
struct swaylock_state *state = surface->state;
|
2018-04-04 17:52:44 -05:00
|
|
|
|
|
|
|
int buffer_width = surface->width * surface->scale;
|
|
|
|
int buffer_height = surface->height * surface->scale;
|
2018-05-23 16:55:57 -05:00
|
|
|
if (buffer_width == 0 || buffer_height == 0) {
|
|
|
|
return; // not yet configured
|
|
|
|
}
|
2018-04-04 17:52:44 -05:00
|
|
|
|
2023-06-08 22:32:52 -05:00
|
|
|
wl_surface_set_buffer_scale(surface->surface, surface->scale);
|
|
|
|
|
2023-03-12 15:48:58 -05:00
|
|
|
if (buffer_width != surface->last_buffer_width ||
|
|
|
|
buffer_height != surface->last_buffer_height) {
|
|
|
|
struct pool_buffer buffer;
|
|
|
|
if (!create_buffer(state->shm, &buffer, buffer_width, buffer_height,
|
|
|
|
WL_SHM_FORMAT_ARGB8888)) {
|
|
|
|
swaylock_log(LOG_ERROR,
|
|
|
|
"Failed to create new buffer for frame background.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
cairo_t *cairo = buffer.cairo;
|
|
|
|
cairo_set_antialias(cairo, CAIRO_ANTIALIAS_BEST);
|
|
|
|
|
|
|
|
cairo_save(cairo);
|
|
|
|
cairo_set_operator(cairo, CAIRO_OPERATOR_SOURCE);
|
|
|
|
cairo_set_source_u32(cairo, state->args.colors.background);
|
|
|
|
cairo_paint(cairo);
|
|
|
|
if (surface->image && state->args.mode != BACKGROUND_MODE_SOLID_COLOR) {
|
|
|
|
cairo_set_operator(cairo, CAIRO_OPERATOR_OVER);
|
|
|
|
render_background_image(cairo, surface->image,
|
|
|
|
state->args.mode, buffer_width, buffer_height);
|
|
|
|
}
|
|
|
|
cairo_restore(cairo);
|
|
|
|
cairo_identity_matrix(cairo);
|
2018-05-25 13:34:36 -05:00
|
|
|
|
2023-03-12 15:48:58 -05:00
|
|
|
wl_surface_attach(surface->surface, buffer.buffer, 0, 0);
|
|
|
|
wl_surface_damage_buffer(surface->surface, 0, 0, INT32_MAX, INT32_MAX);
|
2023-06-08 22:32:52 -05:00
|
|
|
wl_surface_commit(surface->surface);
|
2023-03-12 15:48:58 -05:00
|
|
|
destroy_buffer(&buffer);
|
2018-04-03 18:15:14 -05:00
|
|
|
|
2023-03-12 15:48:58 -05:00
|
|
|
surface->last_buffer_width = buffer_width;
|
|
|
|
surface->last_buffer_height = buffer_height;
|
2023-06-08 22:32:52 -05:00
|
|
|
} else {
|
|
|
|
wl_surface_commit(surface->surface);
|
2018-04-03 14:04:31 -05:00
|
|
|
}
|
2019-03-12 05:16:33 -05:00
|
|
|
}
|
|
|
|
|
2023-01-14 13:51:47 -06:00
|
|
|
static void configure_font_drawing(cairo_t *cairo, struct swaylock_state *state,
|
|
|
|
enum wl_output_subpixel subpixel, int arc_radius) {
|
|
|
|
cairo_font_options_t *fo = cairo_font_options_create();
|
|
|
|
cairo_font_options_set_hint_style(fo, CAIRO_HINT_STYLE_FULL);
|
|
|
|
cairo_font_options_set_antialias(fo, CAIRO_ANTIALIAS_SUBPIXEL);
|
|
|
|
cairo_font_options_set_subpixel_order(fo, to_cairo_subpixel_order(subpixel));
|
|
|
|
|
|
|
|
cairo_set_font_options(cairo, fo);
|
|
|
|
cairo_select_font_face(cairo, state->args.font,
|
|
|
|
CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
|
|
|
|
if (state->args.font_size > 0) {
|
|
|
|
cairo_set_font_size(cairo, state->args.font_size);
|
|
|
|
} else {
|
|
|
|
cairo_set_font_size(cairo, arc_radius / 3.0f);
|
|
|
|
}
|
|
|
|
cairo_font_options_destroy(fo);
|
|
|
|
}
|
|
|
|
|
2019-03-12 05:16:33 -05:00
|
|
|
void render_frame(struct swaylock_surface *surface) {
|
|
|
|
struct swaylock_state *state = surface->state;
|
|
|
|
|
2023-01-14 13:51:47 -06:00
|
|
|
// First, compute the text that will be drawn, if any, since this
|
|
|
|
// determines the size/positioning of the surface
|
|
|
|
|
|
|
|
char attempts[4]; // like i3lock: count no more than 999
|
|
|
|
char *text = NULL;
|
|
|
|
const char *layout_text = NULL;
|
|
|
|
|
2023-05-02 20:00:41 -05:00
|
|
|
bool draw_indicator = state->args.show_indicator &&
|
|
|
|
(state->auth_state != AUTH_STATE_IDLE ||
|
|
|
|
state->input_state != INPUT_STATE_IDLE ||
|
|
|
|
state->args.indicator_idle_visible);
|
|
|
|
|
|
|
|
if (draw_indicator) {
|
|
|
|
if (state->input_state == INPUT_STATE_CLEAR) {
|
|
|
|
// This message has highest priority
|
|
|
|
text = "Cleared";
|
|
|
|
} else if (state->auth_state == AUTH_STATE_VALIDATING) {
|
2023-01-14 13:51:47 -06:00
|
|
|
text = "Verifying";
|
2023-05-02 20:00:41 -05:00
|
|
|
} else if (state->auth_state == AUTH_STATE_INVALID) {
|
2023-01-14 13:51:47 -06:00
|
|
|
text = "Wrong";
|
2023-05-02 20:00:41 -05:00
|
|
|
} else {
|
2023-01-14 13:51:47 -06:00
|
|
|
// Caps Lock has higher priority
|
|
|
|
if (state->xkb.caps_lock && state->args.show_caps_lock_text) {
|
|
|
|
text = "Caps Lock";
|
|
|
|
} else if (state->args.show_failed_attempts &&
|
|
|
|
state->failed_attempts > 0) {
|
|
|
|
if (state->failed_attempts > 999) {
|
|
|
|
text = "999+";
|
|
|
|
} else {
|
|
|
|
snprintf(attempts, sizeof(attempts), "%d", state->failed_attempts);
|
|
|
|
text = attempts;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
xkb_layout_index_t num_layout = xkb_keymap_num_layouts(state->xkb.keymap);
|
|
|
|
if (!state->args.hide_keyboard_layout &&
|
|
|
|
(state->args.show_keyboard_layout || num_layout > 1)) {
|
|
|
|
xkb_layout_index_t curr_layout = 0;
|
|
|
|
|
|
|
|
// advance to the first active layout (if any)
|
|
|
|
while (curr_layout < num_layout &&
|
|
|
|
xkb_state_layout_index_is_active(state->xkb.state,
|
|
|
|
curr_layout, XKB_STATE_LAYOUT_EFFECTIVE) != 1) {
|
|
|
|
++curr_layout;
|
|
|
|
}
|
|
|
|
// will handle invalid index if none are active
|
|
|
|
layout_text = xkb_keymap_layout_get_name(state->xkb.keymap, curr_layout);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Compute the size of the buffer needed
|
2018-07-10 20:29:15 -05:00
|
|
|
int arc_radius = state->args.radius * surface->scale;
|
|
|
|
int arc_thickness = state->args.thickness * surface->scale;
|
2019-03-12 05:16:33 -05:00
|
|
|
int buffer_diameter = (arc_radius + arc_thickness) * 2;
|
2023-01-14 13:51:47 -06:00
|
|
|
int buffer_width = buffer_diameter;
|
|
|
|
int buffer_height = buffer_diameter;
|
2019-03-12 05:16:33 -05:00
|
|
|
|
2023-01-14 13:51:47 -06:00
|
|
|
if (text || layout_text) {
|
|
|
|
cairo_set_antialias(state->test_cairo, CAIRO_ANTIALIAS_BEST);
|
|
|
|
configure_font_drawing(state->test_cairo, state, surface->subpixel, arc_radius);
|
|
|
|
|
|
|
|
if (text) {
|
|
|
|
cairo_text_extents_t extents;
|
|
|
|
cairo_text_extents(state->test_cairo, text, &extents);
|
|
|
|
if (buffer_width < extents.width) {
|
|
|
|
buffer_width = extents.width;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (layout_text) {
|
|
|
|
cairo_text_extents_t extents;
|
|
|
|
cairo_font_extents_t fe;
|
|
|
|
double box_padding = 4.0 * surface->scale;
|
|
|
|
cairo_text_extents(state->test_cairo, layout_text, &extents);
|
|
|
|
cairo_font_extents(state->test_cairo, &fe);
|
|
|
|
buffer_height += fe.height + 2 * box_padding;
|
|
|
|
if (buffer_width < extents.width + 2 * box_padding) {
|
|
|
|
buffer_width = extents.width + 2 * box_padding;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Ensure buffer size is multiple of buffer scale - required by protocol
|
|
|
|
buffer_height += surface->scale - (buffer_height % surface->scale);
|
|
|
|
buffer_width += surface->scale - (buffer_width % surface->scale);
|
2019-06-13 18:41:57 -05:00
|
|
|
|
2019-11-27 18:43:16 -06:00
|
|
|
int subsurf_xpos;
|
|
|
|
int subsurf_ypos;
|
|
|
|
|
|
|
|
// Center the indicator unless overridden by the user
|
|
|
|
if (state->args.override_indicator_x_position) {
|
|
|
|
subsurf_xpos = state->args.indicator_x_position -
|
|
|
|
buffer_width / (2 * surface->scale) + 2 / surface->scale;
|
|
|
|
} else {
|
|
|
|
subsurf_xpos = surface->width / 2 -
|
|
|
|
buffer_width / (2 * surface->scale) + 2 / surface->scale;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (state->args.override_indicator_y_position) {
|
|
|
|
subsurf_ypos = state->args.indicator_y_position -
|
|
|
|
(state->args.radius + state->args.thickness);
|
|
|
|
} else {
|
|
|
|
subsurf_ypos = surface->height / 2 -
|
|
|
|
(state->args.radius + state->args.thickness);
|
|
|
|
}
|
|
|
|
|
2022-09-24 03:18:20 -05:00
|
|
|
struct pool_buffer *buffer = get_next_buffer(state->shm,
|
2019-06-13 18:41:57 -05:00
|
|
|
surface->indicator_buffers, buffer_width, buffer_height);
|
2022-09-24 03:18:20 -05:00
|
|
|
if (buffer == NULL) {
|
2019-03-12 05:16:33 -05:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-01-14 13:51:47 -06:00
|
|
|
// Render the buffer
|
2022-09-24 03:18:20 -05:00
|
|
|
cairo_t *cairo = buffer->cairo;
|
2019-03-12 05:16:33 -05:00
|
|
|
cairo_set_antialias(cairo, CAIRO_ANTIALIAS_BEST);
|
2023-01-14 13:51:47 -06:00
|
|
|
|
2019-03-12 05:16:33 -05:00
|
|
|
cairo_identity_matrix(cairo);
|
|
|
|
|
|
|
|
// Clear
|
|
|
|
cairo_save(cairo);
|
|
|
|
cairo_set_source_rgba(cairo, 0, 0, 0, 0);
|
|
|
|
cairo_set_operator(cairo, CAIRO_OPERATOR_SOURCE);
|
|
|
|
cairo_paint(cairo);
|
|
|
|
cairo_restore(cairo);
|
|
|
|
|
2018-04-04 17:52:44 -05:00
|
|
|
float type_indicator_border_thickness =
|
|
|
|
TYPE_INDICATOR_BORDER_THICKNESS * surface->scale;
|
2018-04-03 18:15:14 -05:00
|
|
|
|
2023-05-02 20:00:41 -05:00
|
|
|
if (draw_indicator) {
|
2021-05-31 16:01:59 -05:00
|
|
|
// Fill inner circle
|
|
|
|
cairo_set_line_width(cairo, 0);
|
|
|
|
cairo_arc(cairo, buffer_width / 2, buffer_diameter / 2,
|
|
|
|
arc_radius - arc_thickness / 2, 0, 2 * M_PI);
|
|
|
|
set_color_for_state(cairo, state, &state->args.colors.inside);
|
|
|
|
cairo_fill_preserve(cairo);
|
|
|
|
cairo_stroke(cairo);
|
|
|
|
|
|
|
|
// Draw ring
|
2018-04-04 17:52:44 -05:00
|
|
|
cairo_set_line_width(cairo, arc_thickness);
|
2019-06-13 18:41:57 -05:00
|
|
|
cairo_arc(cairo, buffer_width / 2, buffer_diameter / 2, arc_radius,
|
2018-07-10 20:29:15 -05:00
|
|
|
0, 2 * M_PI);
|
|
|
|
set_color_for_state(cairo, state, &state->args.colors.ring);
|
|
|
|
cairo_stroke(cairo);
|
2018-04-03 14:04:31 -05:00
|
|
|
|
|
|
|
// Draw a message
|
2023-01-14 13:51:47 -06:00
|
|
|
configure_font_drawing(cairo, state, surface->subpixel, arc_radius);
|
2018-07-10 20:29:15 -05:00
|
|
|
set_color_for_state(cairo, state, &state->args.colors.text);
|
2018-04-03 14:04:31 -05:00
|
|
|
|
|
|
|
if (text) {
|
|
|
|
cairo_text_extents_t extents;
|
2019-01-28 12:51:34 -06:00
|
|
|
cairo_font_extents_t fe;
|
2018-04-03 14:04:31 -05:00
|
|
|
double x, y;
|
|
|
|
cairo_text_extents(cairo, text, &extents);
|
2019-01-28 12:51:34 -06:00
|
|
|
cairo_font_extents(cairo, &fe);
|
2019-06-13 18:41:57 -05:00
|
|
|
x = (buffer_width / 2) -
|
2018-04-03 14:04:31 -05:00
|
|
|
(extents.width / 2 + extents.x_bearing);
|
2019-03-12 05:16:33 -05:00
|
|
|
y = (buffer_diameter / 2) +
|
2019-01-28 12:51:34 -06:00
|
|
|
(fe.height / 2 - fe.descent);
|
2018-04-03 14:04:31 -05:00
|
|
|
|
|
|
|
cairo_move_to(cairo, x, y);
|
|
|
|
cairo_show_text(cairo, text);
|
|
|
|
cairo_close_path(cairo);
|
|
|
|
cairo_new_sub_path(cairo);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Typing indicator: Highlight random part on keypress
|
2023-05-02 20:00:41 -05:00
|
|
|
if (state->input_state == INPUT_STATE_LETTER ||
|
|
|
|
state->input_state == INPUT_STATE_BACKSPACE) {
|
2023-03-28 18:42:19 -05:00
|
|
|
double highlight_start = state->highlight_start * (M_PI / 1024.0);
|
2019-06-13 18:41:57 -05:00
|
|
|
cairo_arc(cairo, buffer_width / 2, buffer_diameter / 2,
|
2018-04-04 17:52:44 -05:00
|
|
|
arc_radius, highlight_start,
|
2018-04-03 14:04:31 -05:00
|
|
|
highlight_start + TYPE_INDICATOR_RANGE);
|
2023-05-02 20:00:41 -05:00
|
|
|
if (state->input_state == INPUT_STATE_LETTER) {
|
2019-01-14 09:51:04 -06:00
|
|
|
if (state->xkb.caps_lock && state->args.show_caps_lock_indicator) {
|
|
|
|
cairo_set_source_u32(cairo, state->args.colors.caps_lock_key_highlight);
|
|
|
|
} else {
|
|
|
|
cairo_set_source_u32(cairo, state->args.colors.key_highlight);
|
|
|
|
}
|
2018-04-03 14:04:31 -05:00
|
|
|
} else {
|
2019-01-14 09:51:04 -06:00
|
|
|
if (state->xkb.caps_lock && state->args.show_caps_lock_indicator) {
|
|
|
|
cairo_set_source_u32(cairo, state->args.colors.caps_lock_bs_highlight);
|
|
|
|
} else {
|
|
|
|
cairo_set_source_u32(cairo, state->args.colors.bs_highlight);
|
|
|
|
}
|
2018-04-03 14:04:31 -05:00
|
|
|
}
|
|
|
|
cairo_stroke(cairo);
|
|
|
|
|
|
|
|
// Draw borders
|
2018-07-10 20:29:15 -05:00
|
|
|
cairo_set_source_u32(cairo, state->args.colors.separator);
|
2019-06-13 18:41:57 -05:00
|
|
|
cairo_arc(cairo, buffer_width / 2, buffer_diameter / 2,
|
2018-04-04 17:52:44 -05:00
|
|
|
arc_radius, highlight_start,
|
|
|
|
highlight_start + type_indicator_border_thickness);
|
2018-04-03 14:04:31 -05:00
|
|
|
cairo_stroke(cairo);
|
|
|
|
|
2019-06-13 18:41:57 -05:00
|
|
|
cairo_arc(cairo, buffer_width / 2, buffer_diameter / 2,
|
2018-04-04 17:52:44 -05:00
|
|
|
arc_radius, highlight_start + TYPE_INDICATOR_RANGE,
|
2018-04-03 14:04:31 -05:00
|
|
|
highlight_start + TYPE_INDICATOR_RANGE +
|
2018-04-04 17:52:44 -05:00
|
|
|
type_indicator_border_thickness);
|
2018-04-03 14:04:31 -05:00
|
|
|
cairo_stroke(cairo);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Draw inner + outer border of the circle
|
2018-07-10 20:29:15 -05:00
|
|
|
set_color_for_state(cairo, state, &state->args.colors.line);
|
2018-04-03 18:15:14 -05:00
|
|
|
cairo_set_line_width(cairo, 2.0 * surface->scale);
|
2019-06-13 18:41:57 -05:00
|
|
|
cairo_arc(cairo, buffer_width / 2, buffer_diameter / 2,
|
2018-04-04 17:52:44 -05:00
|
|
|
arc_radius - arc_thickness / 2, 0, 2 * M_PI);
|
2018-04-03 14:04:31 -05:00
|
|
|
cairo_stroke(cairo);
|
2019-06-13 18:41:57 -05:00
|
|
|
cairo_arc(cairo, buffer_width / 2, buffer_diameter / 2,
|
2018-04-04 17:52:44 -05:00
|
|
|
arc_radius + arc_thickness / 2, 0, 2 * M_PI);
|
2018-04-03 14:04:31 -05:00
|
|
|
cairo_stroke(cairo);
|
2019-02-05 09:12:54 -06:00
|
|
|
|
2021-04-12 11:21:01 -05:00
|
|
|
// display layout text separately
|
2019-02-05 09:12:54 -06:00
|
|
|
if (layout_text) {
|
|
|
|
cairo_text_extents_t extents;
|
|
|
|
cairo_font_extents_t fe;
|
|
|
|
double x, y;
|
|
|
|
double box_padding = 4.0 * surface->scale;
|
|
|
|
cairo_text_extents(cairo, layout_text, &extents);
|
|
|
|
cairo_font_extents(cairo, &fe);
|
|
|
|
// upper left coordinates for box
|
2019-06-13 18:41:57 -05:00
|
|
|
x = (buffer_width / 2) - (extents.width / 2) - box_padding;
|
|
|
|
y = buffer_diameter;
|
2019-02-05 09:12:54 -06:00
|
|
|
|
|
|
|
// background box
|
|
|
|
cairo_rectangle(cairo, x, y,
|
|
|
|
extents.width + 2.0 * box_padding,
|
|
|
|
fe.height + 2.0 * box_padding);
|
|
|
|
cairo_set_source_u32(cairo, state->args.colors.layout_background);
|
|
|
|
cairo_fill_preserve(cairo);
|
|
|
|
// border
|
|
|
|
cairo_set_source_u32(cairo, state->args.colors.layout_border);
|
|
|
|
cairo_stroke(cairo);
|
|
|
|
|
|
|
|
// take font extents and padding into account
|
|
|
|
cairo_move_to(cairo,
|
|
|
|
x - extents.x_bearing + box_padding,
|
|
|
|
y + (fe.height - fe.descent) + box_padding);
|
|
|
|
cairo_set_source_u32(cairo, state->args.colors.layout_text);
|
|
|
|
cairo_show_text(cairo, layout_text);
|
|
|
|
cairo_new_sub_path(cairo);
|
2019-06-13 18:41:57 -05:00
|
|
|
}
|
2021-06-27 22:46:01 -05:00
|
|
|
}
|
2019-06-13 18:41:57 -05:00
|
|
|
|
2023-01-14 13:51:47 -06:00
|
|
|
// Send Wayland requests
|
|
|
|
wl_subsurface_set_position(surface->subsurface, subsurf_xpos, subsurf_ypos);
|
2018-04-03 14:04:31 -05:00
|
|
|
|
2019-03-12 05:16:33 -05:00
|
|
|
wl_surface_set_buffer_scale(surface->child, surface->scale);
|
2022-09-24 03:18:20 -05:00
|
|
|
wl_surface_attach(surface->child, buffer->buffer, 0, 0);
|
2021-02-10 10:45:42 -06:00
|
|
|
wl_surface_damage_buffer(surface->child, 0, 0, INT32_MAX, INT32_MAX);
|
2019-03-12 05:16:33 -05:00
|
|
|
wl_surface_commit(surface->child);
|
|
|
|
|
2018-04-03 13:31:30 -05:00
|
|
|
wl_surface_commit(surface->surface);
|
2018-04-03 14:04:31 -05:00
|
|
|
}
|