Switch from wlr_idle to wlr_idle_notify_v1

The latter implemented the KDE protocol which has been dropped.
This commit is contained in:
Kenny Levinsen 2023-11-21 19:20:13 +01:00 committed by Simon Ser
parent a30f2bcec1
commit 1ff7945ba1
4 changed files with 20 additions and 20 deletions

4
cage.c
View file

@ -25,8 +25,8 @@
#include <wlr/types/wlr_data_device.h>
#include <wlr/types/wlr_export_dmabuf_v1.h>
#include <wlr/types/wlr_gamma_control_v1.h>
#include <wlr/types/wlr_idle.h>
#include <wlr/types/wlr_idle_inhibit_v1.h>
#include <wlr/types/wlr_idle_notify_v1.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_output_management_v1.h>
#include <wlr/types/wlr_presentation_time.h>
@ -374,7 +374,7 @@ main(int argc, char *argv[])
goto end;
}
server.idle = wlr_idle_create(server.wl_display);
server.idle = wlr_idle_notifier_v1_create(server.wl_display);
if (!server.idle) {
wlr_log(WLR_ERROR, "Unable to create the idle tracker");
ret = 1;

View file

@ -8,8 +8,8 @@
#include <stdlib.h>
#include <wayland-server-core.h>
#include <wlr/types/wlr_idle.h>
#include <wlr/types/wlr_idle_inhibit_v1.h>
#include <wlr/types/wlr_idle_notify_v1.h>
#include "idle_inhibit_v1.h"
#include "server.h"
@ -32,7 +32,7 @@ idle_inhibit_v1_check_active(struct cg_server *server)
Hence, we simply check for any inhibitors and inhibit
accordingly. */
bool inhibited = !wl_list_empty(&server->inhibitors);
wlr_idle_set_enabled(server->idle, NULL, !inhibited);
wlr_idle_notifier_v1_set_inhibited(server->idle, inhibited);
}
static void

28
seat.c
View file

@ -20,7 +20,7 @@
#include <wlr/backend/session.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_data_device.h>
#include <wlr/types/wlr_idle.h>
#include <wlr/types/wlr_idle_notify_v1.h>
#include <wlr/types/wlr_keyboard_group.h>
#include <wlr/types/wlr_primary_selection.h>
#include <wlr/types/wlr_relative_pointer_v1.h>
@ -250,7 +250,7 @@ handle_modifier_event(struct wlr_keyboard *keyboard, struct cg_seat *seat)
wlr_seat_set_keyboard(seat->seat, keyboard);
wlr_seat_keyboard_notify_modifiers(seat->seat, &keyboard->modifiers);
wlr_idle_notify_activity(seat->server->idle, seat->seat);
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
}
static bool
@ -272,7 +272,7 @@ handle_keybinding(struct cg_server *server, xkb_keysym_t sym)
} else {
return false;
}
wlr_idle_notify_activity(server->idle, server->seat->seat);
wlr_idle_notifier_v1_notify_activity(server->idle, server->seat->seat);
return true;
}
@ -304,7 +304,7 @@ handle_key_event(struct wlr_keyboard *keyboard, struct cg_seat *seat, void *data
wlr_seat_keyboard_notify_key(seat->seat, event->time_msec, event->keycode, event->state);
}
wlr_idle_notify_activity(seat->server->idle, seat->seat);
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
}
static void
@ -512,7 +512,7 @@ handle_touch_down(struct wl_listener *listener, void *data)
press_cursor_button(seat, &event->touch->base, event->time_msec, BTN_LEFT, WLR_BUTTON_PRESSED, lx, ly);
}
wlr_idle_notify_activity(seat->server->idle, seat->seat);
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
}
static void
@ -531,7 +531,7 @@ handle_touch_up(struct wl_listener *listener, void *data)
}
wlr_seat_touch_notify_up(seat->seat, event->time_msec, event->touch_id);
wlr_idle_notify_activity(seat->server->idle, seat->seat);
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
}
static void
@ -563,7 +563,7 @@ handle_touch_motion(struct wl_listener *listener, void *data)
seat->touch_ly = ly;
}
wlr_idle_notify_activity(seat->server->idle, seat->seat);
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
}
static void
@ -572,7 +572,7 @@ handle_touch_frame(struct wl_listener *listener, void *data)
struct cg_seat *seat = wl_container_of(listener, seat, touch_frame);
wlr_seat_touch_notify_frame(seat->seat);
wlr_idle_notify_activity(seat->server->idle, seat->seat);
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
}
static void
@ -581,7 +581,7 @@ handle_cursor_frame(struct wl_listener *listener, void *data)
struct cg_seat *seat = wl_container_of(listener, seat, cursor_frame);
wlr_seat_pointer_notify_frame(seat->seat);
wlr_idle_notify_activity(seat->server->idle, seat->seat);
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
}
static void
@ -592,7 +592,7 @@ handle_cursor_axis(struct wl_listener *listener, void *data)
wlr_seat_pointer_notify_axis(seat->seat, event->time_msec, event->orientation, event->delta,
event->delta_discrete, event->source);
wlr_idle_notify_activity(seat->server->idle, seat->seat);
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
}
static void
@ -604,7 +604,7 @@ handle_cursor_button(struct wl_listener *listener, void *data)
wlr_seat_pointer_notify_button(seat->seat, event->time_msec, event->button, event->state);
press_cursor_button(seat, &event->pointer->base, event->time_msec, event->button, event->state, seat->cursor->x,
seat->cursor->y);
wlr_idle_notify_activity(seat->server->idle, seat->seat);
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
}
static void
@ -634,7 +634,7 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time_msec, double dx, doubl
drag_icon_update_position(drag_icon);
}
wlr_idle_notify_activity(seat->server->idle, seat->seat);
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
}
static void
@ -651,7 +651,7 @@ handle_cursor_motion_absolute(struct wl_listener *listener, void *data)
wlr_cursor_warp_absolute(seat->cursor, &event->pointer->base, event->x, event->y);
process_cursor_motion(seat, event->time_msec, dx, dy, dx, dy);
wlr_idle_notify_activity(seat->server->idle, seat->seat);
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
}
static void
@ -663,7 +663,7 @@ handle_cursor_motion_relative(struct wl_listener *listener, void *data)
wlr_cursor_move(seat->cursor, &event->pointer->base, event->delta_x, event->delta_y);
process_cursor_motion(seat, event->time_msec, event->delta_x, event->delta_y, event->unaccel_dx,
event->unaccel_dy);
wlr_idle_notify_activity(seat->server->idle, seat->seat);
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
}
static void

View file

@ -4,8 +4,8 @@
#include "config.h"
#include <wayland-server-core.h>
#include <wlr/types/wlr_idle.h>
#include <wlr/types/wlr_idle_inhibit_v1.h>
#include <wlr/types/wlr_idle_notify_v1.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_relative_pointer_v1.h>
#include <wlr/types/wlr_xdg_decoration_v1.h>
@ -27,7 +27,7 @@ struct cg_server {
struct wlr_session *session;
struct cg_seat *seat;
struct wlr_idle *idle;
struct wlr_idle_notifier_v1 *idle;
struct wlr_idle_inhibit_manager_v1 *idle_inhibit_v1;
struct wl_listener new_idle_inhibitor_v1;
struct wl_list inhibitors;