Merge branch 'deferred-cursor-move' into '0.17'

Draft: Deferred cursor move

See merge request wlroots/wlroots!4340
This commit is contained in:
Daniel Hill 2024-06-28 02:20:31 +00:00
commit 6746cf248e
6 changed files with 111 additions and 7 deletions

View file

@ -34,6 +34,8 @@ struct wlr_cursor {
struct wlr_cursor_state *state;
double x, y;
int max_latency;
/**
* The interpretation of these signals is the responsibility of the
* compositor, but some helpers are provided for your benefit. If you
@ -166,6 +168,8 @@ void wlr_cursor_set_xcursor(struct wlr_cursor *cur,
void wlr_cursor_set_surface(struct wlr_cursor *cur, struct wlr_surface *surface,
int32_t hotspot_x, int32_t hotspot_y);
void wlr_cursor_set_max_latency(struct wlr_cursor *cur, int max_latency);
/**
* Attaches this input device to this cursor. The input device must be one of:
*

View file

@ -43,9 +43,15 @@ struct wlr_output_cursor {
struct wlr_fbox src_box;
enum wl_output_transform transform;
int32_t hotspot_x, hotspot_y;
// only when using a software cursor without a surface
struct wlr_texture *texture;
bool own_texture;
struct wl_list link;
struct timespec last_presentation;
bool deferred;
double deferred_x, deferred_y;
int max_latency;
};
enum wlr_output_adaptive_sync_status {
@ -150,6 +156,8 @@ struct wlr_output {
enum wlr_output_adaptive_sync_status adaptive_sync_status;
uint32_t render_format;
int max_cursor_latency;
bool needs_frame;
// damage for cursors and fullscreen surface, in output-local coordinates
bool frame_pending;
@ -561,6 +569,13 @@ bool wlr_output_cursor_set_buffer(struct wlr_output_cursor *cursor,
struct wlr_buffer *buffer, int32_t hotspot_x, int32_t hotspot_y);
bool wlr_output_cursor_move(struct wlr_output_cursor *cursor,
double x, double y);
/**
* Call any_expired() before you check needs_frame.
* call all_deferred() whenever a new frame is needed.
* */
void wlr_output_cursor_move_expired(struct wlr_output_cursor *cursor, struct timespec *now);
void wlr_output_cursor_move_any_expired(struct wlr_output *output, struct timespec *now);
void wlr_output_cursor_move_all_deferred(struct wlr_output *output, struct timespec *now);
void wlr_output_cursor_destroy(struct wlr_output_cursor *cursor);
/**