mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-19 06:47:02 -04:00
Merge branch 'deferred-cursor-move' into '0.17'
Draft: Deferred cursor move See merge request wlroots/wlroots!4340
This commit is contained in:
commit
6746cf248e
6 changed files with 111 additions and 7 deletions
|
|
@ -4,6 +4,8 @@
|
|||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
static const long NSEC_PER_SEC = 1000000000;
|
||||
|
||||
/**
|
||||
* Get the current time, in milliseconds.
|
||||
*/
|
||||
|
|
@ -30,4 +32,6 @@ void timespec_from_nsec(struct timespec *r, int64_t nsec);
|
|||
void timespec_sub(struct timespec *r, const struct timespec *a,
|
||||
const struct timespec *b);
|
||||
|
||||
int32_t mhz_to_nsec(int32_t mhz);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue