Skip to content

Commit 9d45edc

Browse files
committed
- multiple cursor sizes
- 32x32, 48x48, 64x64, 96x96, 128x128 - cursor dpi scaling behaviour similiar to Windows - cursor hotspot fixup - rotate cursor in software
1 parent d63de8a commit 9d45edc

File tree

7 files changed

+2903
-810
lines changed

7 files changed

+2903
-810
lines changed

include/compositor.h

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,21 @@ struct compositor {
9999

100100
struct {
101101
bool is_enabled;
102+
int cursor_size;
103+
const struct cursor_icon *current_cursor;
104+
int current_rotation;
105+
int hot_x, hot_y;
106+
int x, y;
102107

103-
int width;
104-
int height;
105-
int bpp;
106-
int depth;
107-
int pitch;
108-
int size;
109-
108+
bool has_buffer;
109+
int buffer_depth;
110+
int buffer_pitch;
111+
int buffer_width;
112+
int buffer_height;
113+
int buffer_size;
110114
uint32_t drm_fb_id;
111115
uint32_t gem_bo_handle;
112116
uint32_t *buffer;
113-
int x, y;
114117
} cursor;
115118
};
116119

@@ -235,12 +238,14 @@ int compositor_remove_view_callbacks(
235238
int64_t view_id
236239
);
237240

238-
int compositor_set_cursor_enabled(bool enabled);
241+
int compositor_apply_cursor_state(
242+
bool is_enabled,
243+
int rotation,
244+
double device_pixel_ratio
245+
);
239246

240247
int compositor_set_cursor_pos(int x, int y);
241248

242-
int compositor_apply_cursor_skin_for_rotation(int rotation);
243-
244249
int compositor_initialize(
245250
struct drmdev *drmdev
246251
);

include/cursor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ struct cursor_icon {
1010
uint32_t *data;
1111
};
1212

13-
extern const struct cursor_icon cursors[4];
13+
extern const struct cursor_icon cursors[5];
1414
extern int n_cursors;
1515

1616
#endif

0 commit comments

Comments
 (0)