using dirty bits for poll-based frame events

This commit is contained in:
Rakarake 2026-01-22 23:40:06 +01:00
parent 33ceed2d22
commit 3311810666
3 changed files with 94 additions and 9 deletions

View file

@ -8,9 +8,15 @@
/// A desktop layer (wallpaper)
#define OUTPUT_LAYER 1
#define DEFAULT_WIDTH 400
#define DEFAULT_HEIGHT 400
struct surface {
int width, height;
/// Wating to be redrawn.
bool dirty;
struct wl_surface *wl_surface;
struct xdg_surface *xdg_surface;
struct xdg_toplevel *xdg_toplevel;
@ -43,7 +49,8 @@ struct client_state {
EGLContext egl_context;
};
#define EVENT_DRAW 0
#define EVENT_NONE 0
#define EVENT_DRAW 1
struct event {
int type;
@ -58,5 +65,5 @@ struct event {
void wayland_init(struct client_state *state, int output_type);
void commit(struct client_state *state);
/// Provide pointer to be filled.
void wait_for_event(struct client_state *state, struct event event);
struct event wait_for_event(struct client_state *state);