commit 94a8b91561916801a5364390363ce96fab50e460
parent 78ae79d25dd8fb1d1106517a8f4839b12b1031f9
Author: Michael Forney <mforney@mforney.org>
Date: Sat, 8 Feb 2014 03:57:03 -0800
pointer: Remove focus method from handler
Diffstat:
3 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/libswc/compositor.c b/libswc/compositor.c
@@ -88,12 +88,10 @@ struct view
struct wl_list link;
};
-static void handle_focus(struct swc_pointer * pointer);
static bool handle_motion(struct swc_pointer * pointer, uint32_t time);
static void perform_update(void * data);
static const struct swc_pointer_handler pointer_handler = {
- .focus = &handle_focus,
.motion = &handle_motion
};
@@ -761,9 +759,10 @@ static void perform_update(void * data)
compositor.updating = false;
}
-void handle_focus(struct swc_pointer * pointer)
+bool handle_motion(struct swc_pointer * pointer, uint32_t time)
{
struct view * view;
+ struct swc_surface * surface = NULL;
int32_t x, y;
wl_list_for_each(view, &compositor.views, link)
@@ -776,16 +775,13 @@ void handle_focus(struct swc_pointer * pointer)
x - view->base.geometry.x,
y - view->base.geometry.y, NULL))
{
- swc_pointer_set_focus(pointer, view->surface);
- return;
+ surface = view->surface;
+ break;
}
}
- swc_pointer_set_focus(pointer, NULL);
-}
+ swc_pointer_set_focus(pointer, surface);
-bool handle_motion(struct swc_pointer * pointer, uint32_t time)
-{
return false;
}
diff --git a/libswc/pointer.c b/libswc/pointer.c
@@ -354,9 +354,6 @@ void swc_pointer_handle_relative_motion
{
clip_position(pointer, pointer->x + dx, pointer->y + dy);
- if (pointer->handler && pointer->handler->focus)
- pointer->handler->focus(pointer);
-
if ((!pointer->handler || !pointer->handler->motion
|| !pointer->handler->motion(pointer, time))
&& pointer->focus.resource)
diff --git a/libswc/pointer.h b/libswc/pointer.h
@@ -35,7 +35,6 @@ struct swc_pointer;
struct swc_pointer_handler
{
- void (* focus)(struct swc_pointer * pointer);
bool (* motion)(struct swc_pointer * pointer, uint32_t time);
bool (* button)(struct swc_pointer * pointer, uint32_t time,
uint32_t button, uint32_t state);