Skip to content

Commit 1ff7945

Browse files
kennylevinsenemersion
authored andcommitted
Switch from wlr_idle to wlr_idle_notify_v1
The latter implemented the KDE protocol which has been dropped.
1 parent a30f2bc commit 1ff7945

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

cage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#include <wlr/types/wlr_data_device.h>
2626
#include <wlr/types/wlr_export_dmabuf_v1.h>
2727
#include <wlr/types/wlr_gamma_control_v1.h>
28-
#include <wlr/types/wlr_idle.h>
2928
#include <wlr/types/wlr_idle_inhibit_v1.h>
29+
#include <wlr/types/wlr_idle_notify_v1.h>
3030
#include <wlr/types/wlr_output_layout.h>
3131
#include <wlr/types/wlr_output_management_v1.h>
3232
#include <wlr/types/wlr_presentation_time.h>
@@ -374,7 +374,7 @@ main(int argc, char *argv[])
374374
goto end;
375375
}
376376

377-
server.idle = wlr_idle_create(server.wl_display);
377+
server.idle = wlr_idle_notifier_v1_create(server.wl_display);
378378
if (!server.idle) {
379379
wlr_log(WLR_ERROR, "Unable to create the idle tracker");
380380
ret = 1;

idle_inhibit_v1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include <stdlib.h>
1010
#include <wayland-server-core.h>
11-
#include <wlr/types/wlr_idle.h>
1211
#include <wlr/types/wlr_idle_inhibit_v1.h>
12+
#include <wlr/types/wlr_idle_notify_v1.h>
1313

1414
#include "idle_inhibit_v1.h"
1515
#include "server.h"
@@ -32,7 +32,7 @@ idle_inhibit_v1_check_active(struct cg_server *server)
3232
Hence, we simply check for any inhibitors and inhibit
3333
accordingly. */
3434
bool inhibited = !wl_list_empty(&server->inhibitors);
35-
wlr_idle_set_enabled(server->idle, NULL, !inhibited);
35+
wlr_idle_notifier_v1_set_inhibited(server->idle, inhibited);
3636
}
3737

3838
static void

seat.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <wlr/backend/session.h>
2121
#include <wlr/types/wlr_cursor.h>
2222
#include <wlr/types/wlr_data_device.h>
23-
#include <wlr/types/wlr_idle.h>
23+
#include <wlr/types/wlr_idle_notify_v1.h>
2424
#include <wlr/types/wlr_keyboard_group.h>
2525
#include <wlr/types/wlr_primary_selection.h>
2626
#include <wlr/types/wlr_relative_pointer_v1.h>
@@ -250,7 +250,7 @@ handle_modifier_event(struct wlr_keyboard *keyboard, struct cg_seat *seat)
250250
wlr_seat_set_keyboard(seat->seat, keyboard);
251251
wlr_seat_keyboard_notify_modifiers(seat->seat, &keyboard->modifiers);
252252

253-
wlr_idle_notify_activity(seat->server->idle, seat->seat);
253+
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
254254
}
255255

256256
static bool
@@ -272,7 +272,7 @@ handle_keybinding(struct cg_server *server, xkb_keysym_t sym)
272272
} else {
273273
return false;
274274
}
275-
wlr_idle_notify_activity(server->idle, server->seat->seat);
275+
wlr_idle_notifier_v1_notify_activity(server->idle, server->seat->seat);
276276
return true;
277277
}
278278

@@ -304,7 +304,7 @@ handle_key_event(struct wlr_keyboard *keyboard, struct cg_seat *seat, void *data
304304
wlr_seat_keyboard_notify_key(seat->seat, event->time_msec, event->keycode, event->state);
305305
}
306306

307-
wlr_idle_notify_activity(seat->server->idle, seat->seat);
307+
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
308308
}
309309

310310
static void
@@ -512,7 +512,7 @@ handle_touch_down(struct wl_listener *listener, void *data)
512512
press_cursor_button(seat, &event->touch->base, event->time_msec, BTN_LEFT, WLR_BUTTON_PRESSED, lx, ly);
513513
}
514514

515-
wlr_idle_notify_activity(seat->server->idle, seat->seat);
515+
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
516516
}
517517

518518
static void
@@ -531,7 +531,7 @@ handle_touch_up(struct wl_listener *listener, void *data)
531531
}
532532

533533
wlr_seat_touch_notify_up(seat->seat, event->time_msec, event->touch_id);
534-
wlr_idle_notify_activity(seat->server->idle, seat->seat);
534+
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
535535
}
536536

537537
static void
@@ -563,7 +563,7 @@ handle_touch_motion(struct wl_listener *listener, void *data)
563563
seat->touch_ly = ly;
564564
}
565565

566-
wlr_idle_notify_activity(seat->server->idle, seat->seat);
566+
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
567567
}
568568

569569
static void
@@ -572,7 +572,7 @@ handle_touch_frame(struct wl_listener *listener, void *data)
572572
struct cg_seat *seat = wl_container_of(listener, seat, touch_frame);
573573

574574
wlr_seat_touch_notify_frame(seat->seat);
575-
wlr_idle_notify_activity(seat->server->idle, seat->seat);
575+
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
576576
}
577577

578578
static void
@@ -581,7 +581,7 @@ handle_cursor_frame(struct wl_listener *listener, void *data)
581581
struct cg_seat *seat = wl_container_of(listener, seat, cursor_frame);
582582

583583
wlr_seat_pointer_notify_frame(seat->seat);
584-
wlr_idle_notify_activity(seat->server->idle, seat->seat);
584+
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
585585
}
586586

587587
static void
@@ -592,7 +592,7 @@ handle_cursor_axis(struct wl_listener *listener, void *data)
592592

593593
wlr_seat_pointer_notify_axis(seat->seat, event->time_msec, event->orientation, event->delta,
594594
event->delta_discrete, event->source);
595-
wlr_idle_notify_activity(seat->server->idle, seat->seat);
595+
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
596596
}
597597

598598
static void
@@ -604,7 +604,7 @@ handle_cursor_button(struct wl_listener *listener, void *data)
604604
wlr_seat_pointer_notify_button(seat->seat, event->time_msec, event->button, event->state);
605605
press_cursor_button(seat, &event->pointer->base, event->time_msec, event->button, event->state, seat->cursor->x,
606606
seat->cursor->y);
607-
wlr_idle_notify_activity(seat->server->idle, seat->seat);
607+
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
608608
}
609609

610610
static void
@@ -634,7 +634,7 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time_msec, double dx, doubl
634634
drag_icon_update_position(drag_icon);
635635
}
636636

637-
wlr_idle_notify_activity(seat->server->idle, seat->seat);
637+
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
638638
}
639639

640640
static void
@@ -651,7 +651,7 @@ handle_cursor_motion_absolute(struct wl_listener *listener, void *data)
651651

652652
wlr_cursor_warp_absolute(seat->cursor, &event->pointer->base, event->x, event->y);
653653
process_cursor_motion(seat, event->time_msec, dx, dy, dx, dy);
654-
wlr_idle_notify_activity(seat->server->idle, seat->seat);
654+
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
655655
}
656656

657657
static void
@@ -663,7 +663,7 @@ handle_cursor_motion_relative(struct wl_listener *listener, void *data)
663663
wlr_cursor_move(seat->cursor, &event->pointer->base, event->delta_x, event->delta_y);
664664
process_cursor_motion(seat, event->time_msec, event->delta_x, event->delta_y, event->unaccel_dx,
665665
event->unaccel_dy);
666-
wlr_idle_notify_activity(seat->server->idle, seat->seat);
666+
wlr_idle_notifier_v1_notify_activity(seat->server->idle, seat->seat);
667667
}
668668

669669
static void

server.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include "config.h"
55

66
#include <wayland-server-core.h>
7-
#include <wlr/types/wlr_idle.h>
87
#include <wlr/types/wlr_idle_inhibit_v1.h>
8+
#include <wlr/types/wlr_idle_notify_v1.h>
99
#include <wlr/types/wlr_output_layout.h>
1010
#include <wlr/types/wlr_relative_pointer_v1.h>
1111
#include <wlr/types/wlr_xdg_decoration_v1.h>
@@ -27,7 +27,7 @@ struct cg_server {
2727
struct wlr_session *session;
2828

2929
struct cg_seat *seat;
30-
struct wlr_idle *idle;
30+
struct wlr_idle_notifier_v1 *idle;
3131
struct wlr_idle_inhibit_manager_v1 *idle_inhibit_v1;
3232
struct wl_listener new_idle_inhibitor_v1;
3333
struct wl_list inhibitors;

0 commit comments

Comments
 (0)