swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit 166eccd102941117e58a7889cf44630713ecefba
parent 873a3bc0748ea4aa038840da3fd0d201357b9698
Author: Michael Forney <mforney@mforney.org>
Date:   Mon, 25 Nov 2013 18:05:56 -0800

Move compositor pointer_handler to compositor struct

Diffstat:
Mlibswc/compositor.c | 11+++++------
Mlibswc/compositor.h | 3+++
2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/libswc/compositor.c b/libswc/compositor.c @@ -181,11 +181,6 @@ static bool handle_motion(struct swc_pointer * pointer, uint32_t time) return false; } -struct swc_pointer_handler pointer_handler = { - .focus = &handle_focus, - .motion = &handle_motion -}; - static void handle_drm_event(struct wl_listener * listener, void * data) { struct swc_event * event = data; @@ -321,6 +316,10 @@ bool swc_compositor_initialize(struct swc_compositor * compositor, compositor->compositor_class.interface = &swc_compositor_class_implementation; compositor->cursor_class.interface = &swc_cursor_class_implementation; + compositor->pointer_handler = (struct swc_pointer_handler) { + .focus = &handle_focus, + .motion = &handle_motion + }; /* TODO: configurable seat */ if (!swc_seat_initialize(&compositor->seat, default_seat)) @@ -330,7 +329,7 @@ bool swc_compositor_initialize(struct swc_compositor * compositor, } swc_seat_add_event_sources(&compositor->seat, event_loop); - compositor->seat.pointer.handler = &pointer_handler; + compositor->seat.pointer.handler = &compositor->pointer_handler; wl_signal_add(&compositor->seat.pointer.event_signal, &compositor->pointer_listener); diff --git a/libswc/compositor.h b/libswc/compositor.h @@ -2,6 +2,7 @@ #define SWC_COMPOSITOR_H #include "drm.h" +#include "pointer.h" #include "seat.h" #include "renderer.h" @@ -36,6 +37,8 @@ struct swc_compositor struct swc_surface_class compositor_class; struct swc_surface_class cursor_class; + struct swc_pointer_handler pointer_handler; + struct wl_listener drm_listener; struct wl_listener pointer_listener;