mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-21 05:33:45 -04:00
render: don’t (can’t) use cursor-shape-v1 when user has set a custom cursor
Well, we _could_, but we’d have to reverse map the string to a cursor-shape-v1 enum value. Let’s not do that, for now at least.
This commit is contained in:
parent
9155948ac8
commit
ddd6004b27
2 changed files with 24 additions and 14 deletions
11
render.c
11
render.c
|
|
@ -4271,7 +4271,9 @@ render_xcursor_update(struct seat *seat)
|
||||||
xassert(seat->pointer.cursor != NULL);
|
xassert(seat->pointer.cursor != NULL);
|
||||||
|
|
||||||
#if defined(HAVE_CURSOR_SHAPE)
|
#if defined(HAVE_CURSOR_SHAPE)
|
||||||
if (seat->pointer.shape_device != NULL) {
|
if (seat->pointer.shape_device != NULL &&
|
||||||
|
seat->pointer.shape != CURSOR_SHAPE_CUSTOM)
|
||||||
|
{
|
||||||
LOG_DBG("setting cursor shape using cursor-shape-v1");
|
LOG_DBG("setting cursor shape using cursor-shape-v1");
|
||||||
wp_cursor_shape_device_v1_set_shape(
|
wp_cursor_shape_device_v1_set_shape(
|
||||||
seat->pointer.shape_device,
|
seat->pointer.shape_device,
|
||||||
|
|
@ -4449,7 +4451,8 @@ render_refresh_urls(struct terminal *term)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
render_xcursor_set(struct seat *seat, struct terminal *term, enum cursor_shape shape)
|
render_xcursor_set(struct seat *seat, struct terminal *term,
|
||||||
|
enum cursor_shape shape)
|
||||||
{
|
{
|
||||||
if (seat->pointer.theme == NULL)
|
if (seat->pointer.theme == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -4469,7 +4472,9 @@ render_xcursor_set(struct seat *seat, struct terminal *term, enum cursor_shape s
|
||||||
|
|
||||||
/* TODO: skip this when using server-side cursors */
|
/* TODO: skip this when using server-side cursors */
|
||||||
if (shape != CURSOR_SHAPE_HIDDEN) {
|
if (shape != CURSOR_SHAPE_HIDDEN) {
|
||||||
const char *const xcursor = cursor_shape_to_string(shape);
|
const char *const xcursor = shape == CURSOR_SHAPE_CUSTOM
|
||||||
|
? term->mouse_user_cursor
|
||||||
|
: cursor_shape_to_string(shape);
|
||||||
const char *const fallback =
|
const char *const fallback =
|
||||||
cursor_shape_to_string(CURSOR_SHAPE_TEXT_FALLBACK);
|
cursor_shape_to_string(CURSOR_SHAPE_TEXT_FALLBACK);
|
||||||
|
|
||||||
|
|
|
||||||
27
terminal.c
27
terminal.c
|
|
@ -3126,19 +3126,24 @@ term_xcursor_update_for_seat(struct terminal *term, struct seat *seat)
|
||||||
enum cursor_shape shape = CURSOR_SHAPE_NONE;
|
enum cursor_shape shape = CURSOR_SHAPE_NONE;
|
||||||
|
|
||||||
switch (term->active_surface) {
|
switch (term->active_surface) {
|
||||||
case TERM_SURF_GRID: {
|
case TERM_SURF_GRID:
|
||||||
bool have_custom_cursor =
|
if (seat->pointer.hidden)
|
||||||
render_xcursor_is_valid(seat, term->mouse_user_cursor);
|
shape = CURSOR_SHAPE_HIDDEN;
|
||||||
|
|
||||||
shape = seat->pointer.hidden ? CURSOR_SHAPE_HIDDEN
|
else if (render_xcursor_is_valid(seat, term->mouse_user_cursor))
|
||||||
: have_custom_cursor ? CURSOR_SHAPE_CUSTOM //term->mouse_user_cursor
|
shape = CURSOR_SHAPE_CUSTOM;
|
||||||
: term->is_searching ? CURSOR_SHAPE_LEFT_PTR
|
|
||||||
: (seat->mouse.col >= 0 &&
|
else if (seat->mouse.col >= 0 &&
|
||||||
seat->mouse.row >= 0 &&
|
seat->mouse.row >= 0 &&
|
||||||
term_mouse_grabbed(term, seat)) ? CURSOR_SHAPE_TEXT
|
term_mouse_grabbed(term, seat))
|
||||||
: CURSOR_SHAPE_LEFT_PTR;
|
{
|
||||||
|
shape = CURSOR_SHAPE_TEXT;
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
shape = CURSOR_SHAPE_LEFT_PTR;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case TERM_SURF_TITLE:
|
case TERM_SURF_TITLE:
|
||||||
case TERM_SURF_BUTTON_MINIMIZE:
|
case TERM_SURF_BUTTON_MINIMIZE:
|
||||||
case TERM_SURF_BUTTON_MAXIMIZE:
|
case TERM_SURF_BUTTON_MAXIMIZE:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue