pointer/keyboard: Rearrange slightly

This commit is contained in:
Jasper St. Pierre 2014-04-18 10:15:40 -04:00
parent 92340fd8da
commit 5f29b8c206
4 changed files with 16 additions and 15 deletions

View File

@ -271,11 +271,11 @@ meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard,
struct wl_display *display) struct wl_display *display)
{ {
memset (keyboard, 0, sizeof *keyboard); memset (keyboard, 0, sizeof *keyboard);
keyboard->xkb_info.keymap_fd = -1;
keyboard->display = display;
wl_list_init (&keyboard->resource_list); wl_list_init (&keyboard->resource_list);
wl_list_init (&keyboard->focus_resource_list); wl_list_init (&keyboard->focus_resource_list);
wl_array_init (&keyboard->keys);
keyboard->focus_surface_listener.notify = keyboard_handle_focus_surface_destroy; keyboard->focus_surface_listener.notify = keyboard_handle_focus_surface_destroy;
@ -283,9 +283,10 @@ meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard,
keyboard->default_grab.keyboard = keyboard; keyboard->default_grab.keyboard = keyboard;
keyboard->grab = &keyboard->default_grab; keyboard->grab = &keyboard->default_grab;
keyboard->display = display; wl_array_init (&keyboard->keys);
keyboard->xkb_context = xkb_context_new (0 /* flags */); keyboard->xkb_context = xkb_context_new (0 /* flags */);
keyboard->xkb_info.keymap_fd = -1;
/* Compute a default until gnome-settings-daemon starts and sets /* Compute a default until gnome-settings-daemon starts and sets
the appropriate values the appropriate values

View File

@ -77,6 +77,8 @@ typedef struct
struct _MetaWaylandKeyboard struct _MetaWaylandKeyboard
{ {
struct wl_display *display;
struct wl_list resource_list; struct wl_list resource_list;
struct wl_list focus_resource_list; struct wl_list focus_resource_list;
@ -92,8 +94,6 @@ struct _MetaWaylandKeyboard
struct wl_array keys; struct wl_array keys;
struct wl_display *display;
struct xkb_context *xkb_context; struct xkb_context *xkb_context;
MetaWaylandXkbInfo xkb_info; MetaWaylandXkbInfo xkb_info;

View File

@ -302,6 +302,11 @@ meta_wayland_pointer_init (MetaWaylandPointer *pointer,
pointer->focus_surface_listener.notify = pointer_handle_focus_surface_destroy; pointer->focus_surface_listener.notify = pointer_handle_focus_surface_destroy;
pointer->cursor_surface = NULL;
pointer->cursor_surface_destroy_listener.notify = pointer_handle_cursor_surface_destroy;
pointer->hotspot_x = 16;
pointer->hotspot_y = 16;
pointer->default_grab.interface = &default_pointer_grab_interface; pointer->default_grab.interface = &default_pointer_grab_interface;
pointer->default_grab.pointer = pointer; pointer->default_grab.pointer = pointer;
pointer->grab = &pointer->default_grab; pointer->grab = &pointer->default_grab;
@ -323,11 +328,6 @@ meta_wayland_pointer_init (MetaWaylandPointer *pointer,
clutter_input_device_get_coords (device, NULL, &current); clutter_input_device_get_coords (device, NULL, &current);
pointer->x = wl_fixed_from_double (current.x); pointer->x = wl_fixed_from_double (current.x);
pointer->y = wl_fixed_from_double (current.y); pointer->y = wl_fixed_from_double (current.y);
pointer->cursor_surface = NULL;
pointer->cursor_surface_destroy_listener.notify = pointer_handle_cursor_surface_destroy;
pointer->hotspot_x = 16;
pointer->hotspot_y = 16;
} }
void void

View File

@ -51,16 +51,16 @@ struct _MetaWaylandPointer
struct wl_list resource_list; struct wl_list resource_list;
struct wl_list focus_resource_list; struct wl_list focus_resource_list;
MetaCursorTracker *cursor_tracker;
MetaWaylandSurface *cursor_surface;
struct wl_listener cursor_surface_destroy_listener;
int hotspot_x, hotspot_y;
MetaWaylandSurface *focus_surface; MetaWaylandSurface *focus_surface;
struct wl_listener focus_surface_listener; struct wl_listener focus_surface_listener;
guint32 focus_serial; guint32 focus_serial;
guint32 click_serial; guint32 click_serial;
MetaCursorTracker *cursor_tracker;
MetaWaylandSurface *cursor_surface;
struct wl_listener cursor_surface_destroy_listener;
int hotspot_x, hotspot_y;
MetaWaylandPointerGrab *grab; MetaWaylandPointerGrab *grab;
MetaWaylandPointerGrab default_grab; MetaWaylandPointerGrab default_grab;
wl_fixed_t grab_x, grab_y; wl_fixed_t grab_x, grab_y;