reformat and fix compiler warnings

This commit is contained in:
Daniel Barlow 2022-07-13 23:57:14 +01:00
parent e7b0bae792
commit ccd7b10d92
3 changed files with 44 additions and 46 deletions

View file

@ -16,8 +16,8 @@
#include <wlr/types/wlr_pointer.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_touch.h>
#include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_touch.h>
#include <wlr/types/wlr_xcursor_manager.h>
#include <wlr/util/log.h>
@ -144,11 +144,7 @@ cursor_touch_down_notify(struct wl_listener *listener, void *data)
double ly = 1440 * event->y;
double sx, sy;
struct kiwmi_view *view = view_at(
desktop,
lx, ly,
&surface,
&sx, &sy);
(void)view_at(desktop, lx, ly, &surface, &sx, &sy);
/* we send the event to lua with 0..1 co-ordinates, because
* it may not be over any surface
@ -162,11 +158,10 @@ cursor_touch_down_notify(struct wl_listener *listener, void *data)
wl_signal_emit(&cursor->events.touch, &new_event);
if(!new_event.handled &&
surface &&
wlr_surface_accepts_touch(seat, surface)) {
wlr_seat_touch_notify_down(seat, surface, event->time_msec,
event->touch_id, sx, sy);
if (!new_event.handled && surface
&& wlr_surface_accepts_touch(seat, surface)) {
wlr_seat_touch_notify_down(
seat, surface, event->time_msec, event->touch_id, sx, sy);
}
}
@ -214,13 +209,13 @@ cursor_touch_motion_notify(struct wl_listener *listener, void *data)
/* UNSURE: should we still send this even if the touch_down
* didn't get sent because the surface doesn't accept
* touch? */
wlr_seat_touch_notify_motion(seat, event->time_msec,
event->touch_id, event->x, event->y);
wlr_seat_touch_notify_motion(
seat, event->time_msec, event->touch_id, event->x, event->y);
}
}
static void
cursor_touch_frame_notify(struct wl_listener *listener, void *data)
cursor_touch_frame_notify(struct wl_listener *listener, void *UNUSED(data))
{
struct kiwmi_cursor *cursor =
wl_container_of(listener, cursor, cursor_touch_frame);
@ -374,16 +369,19 @@ cursor_create(
wl_signal_add(&cursor->cursor->events.frame, &cursor->cursor_frame);
cursor->cursor_touch_down.notify = cursor_touch_down_notify;
wl_signal_add(&cursor->cursor->events.touch_down, &cursor->cursor_touch_down);
wl_signal_add(
&cursor->cursor->events.touch_down, &cursor->cursor_touch_down);
cursor->cursor_touch_up.notify = cursor_touch_up_notify;
wl_signal_add(&cursor->cursor->events.touch_up, &cursor->cursor_touch_up);
cursor->cursor_touch_motion.notify = cursor_touch_motion_notify;
wl_signal_add(&cursor->cursor->events.touch_motion, &cursor->cursor_touch_motion);
wl_signal_add(
&cursor->cursor->events.touch_motion, &cursor->cursor_touch_motion);
cursor->cursor_touch_frame.notify = cursor_touch_frame_notify;
wl_signal_add(&cursor->cursor->events.touch_frame, &cursor->cursor_touch_frame);
wl_signal_add(
&cursor->cursor->events.touch_frame, &cursor->cursor_touch_frame);
wl_signal_init(&cursor->events.button_down);
wl_signal_init(&cursor->events.button_up);