swc

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

commit 6e324f8370afbfcb55a260d073068925480ef90c
parent 312d612940c59bd174e6b1fcada5b7175862c7bb
Author: Michael Forney <mforney@mforney.org>
Date:   Fri, 21 Jun 2013 00:57:18 -0700

Use wl_resource_find_for_client

Diffstat:
Mkeyboard.c | 2+-
Mpointer.c | 2+-
Mutil.c | 21---------------------
Mutil.h | 3---
4 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/keyboard.c b/keyboard.c @@ -42,7 +42,7 @@ void swc_keyboard_set_focus(struct swc_keyboard * keyboard, if (surface) { client = wl_resource_get_client(surface->resource); - resource = swc_find_resource_for_client(&keyboard->resources, client); + resource = wl_resource_find_for_client(&keyboard->resources, client); printf("keyboard: focusing surface: %p\n", surface); diff --git a/pointer.c b/pointer.c @@ -44,7 +44,7 @@ void swc_pointer_set_focus(struct swc_pointer * pointer, if (surface) { client = wl_resource_get_client(surface->resource); - resource = swc_find_resource_for_client(&pointer->resources, client); + resource = wl_resource_find_for_client(&pointer->resources, client); printf("pointer: focusing surface: %p\n", surface); diff --git a/util.c b/util.c @@ -9,24 +9,3 @@ void swc_unbind_resource(struct wl_resource * resource) free(resource); } -struct wl_resource * swc_find_resource_for_client(struct wl_list * resources, - struct wl_client * client) -{ - struct wl_resource * resource; - - printf("looking for client %p\n", client); - - wl_list_for_each(resource, resources, link) - { - if (wl_resource_get_client(resource) == client) - { - printf("found client\n"); - return resource; - } - } - - printf("couldn't find resource\n"); - - return NULL; -} - diff --git a/util.h b/util.h @@ -5,8 +5,5 @@ void swc_unbind_resource(struct wl_resource * resource); -struct wl_resource * swc_find_resource_for_client(struct wl_list * resources, - struct wl_client * client); - #endif