~ruther/dwl

fa400c5d3d1a118389da8d3bfbda7c04f81e5f9f — save196 2 months ago 40b0ae7
don't run axis bindings when locked
1 files changed, 12 insertions(+), 10 deletions(-)

M dwl.c
M dwl.c => dwl.c +12 -10
@@ 663,16 663,18 @@ axisnotify(struct wl_listener *listener, void *data)

	wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);

	if (event->orientation == WL_POINTER_AXIS_VERTICAL_SCROLL)
		adir = event->delta > 0 ? AxisDown : AxisUp;
	else
		adir = event->delta > 0 ? AxisRight : AxisLeft;
	keyboard = wlr_seat_get_keyboard(seat);
	mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
	for (a = axes; a < END(axes); a++) {
		if (CLEANMASK(mods) == CLEANMASK(a->mod) && adir == a->dir && a->func) {
			a->func(&a->arg);
			return;
	if (!locked) {
		if (event->orientation == WL_POINTER_AXIS_VERTICAL_SCROLL)
			adir = event->delta > 0 ? AxisDown : AxisUp;
		else
			adir = event->delta > 0 ? AxisRight : AxisLeft;
		keyboard = wlr_seat_get_keyboard(seat);
		mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
		for (a = axes; a < END(axes); a++) {
			if (CLEANMASK(mods) == CLEANMASK(a->mod) && adir == a->dir && a->func) {
				a->func(&a->arg);
				return;
			}
		}
	}