[mutter] keyboard: Reorder
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] keyboard: Reorder
- Date: Thu, 17 Apr 2014 23:16:26 +0000 (UTC)
commit 4f2dc77ec3304166fc75d6f9270aef5b74c9d9ff
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Apr 17 18:50:16 2014 -0400
keyboard: Reorder
The correct order is:
init
release
update
handle_event
set_focus
start_grab
end_grab
other stuff
src/wayland/meta-wayland-keyboard.c | 66 +++++++++++++++++-----------------
src/wayland/meta-wayland-keyboard.h | 29 ++++++++-------
2 files changed, 48 insertions(+), 47 deletions(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index d5020da..99222ee 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -239,29 +239,6 @@ default_grab_key (MetaWaylandKeyboardGrab *grab,
}
static void
-move_resources (struct wl_list *destination, struct wl_list *source)
-{
- wl_list_insert_list (destination, source);
- wl_list_init (source);
-}
-
-static void
-move_resources_for_client (struct wl_list *destination,
- struct wl_list *source,
- struct wl_client *client)
-{
- struct wl_resource *resource, *tmp;
- wl_resource_for_each_safe (resource, tmp, source)
- {
- if (wl_resource_get_client (resource) == client)
- {
- wl_list_remove (wl_resource_get_link (resource));
- wl_list_insert (destination, wl_resource_get_link (resource));
- }
- }
-}
-
-static void
default_grab_modifiers (MetaWaylandKeyboardGrab *grab, uint32_t serial,
uint32_t mods_depressed, uint32_t mods_latched,
uint32_t mods_locked, uint32_t group)
@@ -328,6 +305,16 @@ meta_wayland_xkb_info_destroy (MetaWaylandXkbInfo *xkb_info)
close (xkb_info->keymap_fd);
}
+void
+meta_wayland_keyboard_release (MetaWaylandKeyboard *keyboard)
+{
+ meta_wayland_xkb_info_destroy (&keyboard->xkb_info);
+ xkb_context_unref (keyboard->xkb_context);
+
+ /* XXX: What about keyboard->resource_list? */
+ wl_array_release (&keyboard->keys);
+}
+
static void
update_pressed_keys (MetaWaylandKeyboard *keyboard,
uint32_t evdev_code,
@@ -429,6 +416,29 @@ meta_wayland_keyboard_handle_event (MetaWaylandKeyboard *keyboard,
return handled;
}
+static void
+move_resources (struct wl_list *destination, struct wl_list *source)
+{
+ wl_list_insert_list (destination, source);
+ wl_list_init (source);
+}
+
+static void
+move_resources_for_client (struct wl_list *destination,
+ struct wl_list *source,
+ struct wl_client *client)
+{
+ struct wl_resource *resource, *tmp;
+ wl_resource_for_each_safe (resource, tmp, source)
+ {
+ if (wl_resource_get_client (resource) == client)
+ {
+ wl_list_remove (wl_resource_get_link (resource));
+ wl_list_insert (destination, wl_resource_get_link (resource));
+ }
+ }
+}
+
void
meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
MetaWaylandSurface *surface)
@@ -513,16 +523,6 @@ meta_wayland_keyboard_end_grab (MetaWaylandKeyboard *keyboard)
}
void
-meta_wayland_keyboard_release (MetaWaylandKeyboard *keyboard)
-{
- meta_wayland_xkb_info_destroy (&keyboard->xkb_info);
- xkb_context_unref (keyboard->xkb_context);
-
- /* XXX: What about keyboard->resource_list? */
- wl_array_release (&keyboard->keys);
-}
-
-void
meta_wayland_keyboard_set_keymap_names (MetaWaylandKeyboard *keyboard,
const char *rules,
const char *model,
diff --git a/src/wayland/meta-wayland-keyboard.h b/src/wayland/meta-wayland-keyboard.h
index 38011c9..972bfc5 100644
--- a/src/wayland/meta-wayland-keyboard.h
+++ b/src/wayland/meta-wayland-keyboard.h
@@ -105,18 +105,13 @@ gboolean
meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard,
struct wl_display *display);
-typedef enum {
- META_WAYLAND_KEYBOARD_SKIP_XCLIENTS = 1,
-} MetaWaylandKeyboardSetKeymapFlags;
+void
+meta_wayland_keyboard_release (MetaWaylandKeyboard *keyboard);
void
-meta_wayland_keyboard_set_keymap_names (MetaWaylandKeyboard *keyboard,
- const char *rules,
- const char *model,
- const char *layout,
- const char *variant,
- const char *options,
- int flags);
+meta_wayland_keyboard_update (MetaWaylandKeyboard *keyboard,
+ const ClutterKeyEvent *event);
+
gboolean
meta_wayland_keyboard_handle_event (MetaWaylandKeyboard *keyboard,
const ClutterKeyEvent *event);
@@ -132,12 +127,18 @@ meta_wayland_keyboard_start_grab (MetaWaylandKeyboard *device,
void
meta_wayland_keyboard_end_grab (MetaWaylandKeyboard *keyboard);
-void
-meta_wayland_keyboard_release (MetaWaylandKeyboard *keyboard);
+typedef enum {
+ META_WAYLAND_KEYBOARD_SKIP_XCLIENTS = 1,
+} MetaWaylandKeyboardSetKeymapFlags;
void
-meta_wayland_keyboard_update (MetaWaylandKeyboard *keyboard,
- const ClutterKeyEvent *event);
+meta_wayland_keyboard_set_keymap_names (MetaWaylandKeyboard *keyboard,
+ const char *rules,
+ const char *model,
+ const char *layout,
+ const char *variant,
+ const char *options,
+ int flags);
struct wl_client *
meta_wayland_keyboard_get_focus_client (MetaWaylandKeyboard *keyboard);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]