프로그램 사용/wayland2024. 2. 26. 16:48

weston.ini 에 추가해서 아예 커서를 그리지 않게 하는 방법

static void
pointer_set_cursor(struct wl_client *client, struct wl_resource *resource,
   uint32_t serial, struct wl_resource *surface_resource,
   int32_t x, int32_t y)
{
struct weston_pointer *pointer = wl_resource_get_user_data(resource);
struct weston_surface *surface = NULL;

if (!pointer)
return;

if (surface_resource)
surface = wl_resource_get_user_data(surface_resource);

if (pointer->focus == NULL)
return;
/* pointer->focus->surface->resource can be NULL. Surfaces like the
black_surface used in shell.c for fullscreen don't have
a resource, but can still have focus */
if (pointer->focus->surface->resource == NULL)
return;
if (wl_resource_get_client(pointer->focus->surface->resource) != client)
return;
if (pointer->focus_serial - serial > UINT32_MAX / 2)
return;

if (!surface) {
if (pointer->sprite)
pointer_unmap_sprite(pointer);
return;
}

if (pointer->sprite && pointer->sprite->surface == surface &&
    pointer->hotspot_x == x && pointer->hotspot_y == y)
return;

if (!pointer->sprite || pointer->sprite->surface != surface) {
if (pointer->seat->compositor->hide_cursor)
return;

if (weston_surface_set_role(surface, "wl_pointer-cursor",
    resource,
    WL_POINTER_ERROR_ROLE) < 0)
return;

if (pointer->sprite)
pointer_unmap_sprite(pointer);

wl_signal_add(&surface->destroy_signal,
      &pointer->sprite_destroy_listener);

surface->committed = pointer_cursor_surface_committed;
surface->committed_private = pointer;
weston_surface_set_label_func(surface,
    pointer_cursor_surface_get_label);
pointer->sprite = weston_view_create(surface);
}

pointer->hotspot_x = x;
pointer->hotspot_y = y;

if (surface->buffer_ref.buffer) {
pointer_cursor_surface_committed(surface, 0, 0);
weston_view_schedule_repaint(pointer->sprite);
}
}

[링크 : https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/345/diffs]

[링크 : https://gitlab.freedesktop.org/wayland/weston/-/blob/f964b59c8af8505422cac79de2466e0a31702a0d/libweston/input.c]

'프로그램 사용 > wayland' 카테고리의 다른 글

weston evdev libinput  (0) 2024.03.11
wayland hdmi - touch 연결  (0) 2023.09.08
wayland atomic commit 패치?  (0) 2022.08.22
weston screen shooter 뜯어보기  (0) 2022.08.17
wayland glreadpixels 실패  (0) 2022.08.16
Posted by 구차니