Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Commit

Permalink
drop support for the kde idle protocol
Browse files Browse the repository at this point in the history
use ext-idle-notify-v1
  • Loading branch information
sevz17 committed Jun 9, 2023
1 parent 24a337e commit 0e6d4e3
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions dwl.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <wlr/types/wlr_export_dmabuf_v1.h>
#include <wlr/types/wlr_fractional_scale_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_input_device.h>
Expand Down Expand Up @@ -72,7 +71,6 @@
#define END(A) ((A) + LENGTH(A))
#define TAGMASK ((1u << tagcount) - 1)
#define LISTEN(E, L, H) wl_signal_add((E), ((L)->notify = (H), (L)))
#define IDLE_NOTIFY_ACTIVITY wlr_idle_notify_activity(idle, seat), wlr_idle_notifier_v1_notify_activity(idle_notifier, seat)

/* enums */
enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */
Expand Down Expand Up @@ -347,7 +345,6 @@ static struct wlr_xdg_activation_v1 *activation;
static struct wlr_xdg_decoration_manager_v1 *xdg_decoration_mgr;
static struct wl_list clients; /* tiling order */
static struct wl_list fstack; /* focus order */
static struct wlr_idle *idle;
static struct wlr_idle_notifier_v1 *idle_notifier;
static struct wlr_idle_inhibit_manager_v1 *idle_inhibit_mgr;
static struct wlr_input_inhibit_manager *input_inhibit_mgr;
Expand Down Expand Up @@ -570,7 +567,7 @@ axisnotify(struct wl_listener *listener, void *data)
/* This event is forwarded by the cursor when a pointer emits an axis event,
* for example when you move the scroll wheel. */
struct wlr_pointer_axis_event *event = data;
IDLE_NOTIFY_ACTIVITY;
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
/* TODO: allow usage of scroll whell for mousebindings, it can be implemented
* checking the event's orientation and the delta of the event */
/* Notify the client with pointer focus of the axis event. */
Expand All @@ -588,7 +585,7 @@ buttonpress(struct wl_listener *listener, void *data)
Client *c;
const Button *b;

IDLE_NOTIFY_ACTIVITY;
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);

switch (event->state) {
case WLR_BUTTON_PRESSED:
Expand Down Expand Up @@ -657,7 +654,6 @@ checkidleinhibitor(struct wlr_surface *exclude)
}
}

wlr_idle_set_enabled(idle, NULL, !inhibited);
wlr_idle_notifier_v1_set_inhibited(idle_notifier, inhibited);
}

Expand Down Expand Up @@ -1429,7 +1425,7 @@ keypress(struct wl_listener *listener, void *data)
int handled = 0;
uint32_t mods = wlr_keyboard_get_modifiers(kb->wlr_keyboard);

IDLE_NOTIFY_ACTIVITY;
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);

/* On _press_ if there is no active screen locker,
* attempt to process a compositor keybinding. */
Expand Down Expand Up @@ -1655,7 +1651,7 @@ motionnotify(uint32_t time)

/* time is 0 in internal calls meant to restore pointer focus. */
if (time) {
IDLE_NOTIFY_ACTIVITY;
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);

/* Update selmon (even while dragging a window) */
if (sloppyfocus)
Expand Down Expand Up @@ -2273,7 +2269,6 @@ setup(void)
wl_list_init(&clients);
wl_list_init(&fstack);

idle = wlr_idle_create(dpy);
idle_notifier = wlr_idle_notifier_v1_create(dpy);

idle_inhibit_mgr = wlr_idle_inhibit_v1_create(dpy);
Expand Down

0 comments on commit 0e6d4e3

Please sign in to comment.