wayland: Remove is_native from seat

We can easily do this with a Clutter backend check instead...
This commit is contained in:
Jasper St. Pierre 2014-02-17 20:49:04 -05:00
parent f26de405dd
commit 304a525744
7 changed files with 25 additions and 23 deletions

View File

@ -201,13 +201,17 @@ meta_wayland_keyboard_take_keymap (MetaWaylandKeyboard *keyboard,
strcpy (xkb_info->keymap_area, keymap_str); strcpy (xkb_info->keymap_area, keymap_str);
free (keymap_str); free (keymap_str);
if (keyboard->is_evdev) #if defined(CLUTTER_WINDOWING_EGL)
/* XXX -- the evdev backend can be used regardless of the
* windowing backend. To do this properly we need a Clutter
* API to check the input backend. */
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_EGL))
{ {
ClutterDeviceManager *manager; ClutterDeviceManager *manager;
manager = clutter_device_manager_get_default (); manager = clutter_device_manager_get_default ();
clutter_evdev_set_keyboard_map (manager, xkb_info->keymap); clutter_evdev_set_keyboard_map (manager, xkb_info->keymap);
} }
#endif
inform_clients_of_new_keymap (keyboard, flags); inform_clients_of_new_keymap (keyboard, flags);
@ -331,8 +335,7 @@ static MetaWaylandKeyboardGrabInterface modal_grab = {
gboolean gboolean
meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard, meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard,
struct wl_display *display, struct wl_display *display)
gboolean is_evdev)
{ {
memset (keyboard, 0, sizeof *keyboard); memset (keyboard, 0, sizeof *keyboard);
keyboard->xkb_info.keymap_fd = -1; keyboard->xkb_info.keymap_fd = -1;
@ -347,7 +350,6 @@ meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard,
keyboard->display = display; keyboard->display = display;
keyboard->xkb_context = xkb_context_new (0 /* flags */); keyboard->xkb_context = xkb_context_new (0 /* flags */);
keyboard->is_evdev = is_evdev;
/* 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

@ -110,7 +110,6 @@ struct _MetaWaylandKeyboard
struct wl_display *display; struct wl_display *display;
struct xkb_context *xkb_context; struct xkb_context *xkb_context;
gboolean is_evdev;
MetaWaylandXkbInfo xkb_info; MetaWaylandXkbInfo xkb_info;
MetaWaylandKeyboardGrab input_method_grab; MetaWaylandKeyboardGrab input_method_grab;
@ -119,8 +118,7 @@ struct _MetaWaylandKeyboard
gboolean gboolean
meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard, meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard,
struct wl_display *display, struct wl_display *display);
gboolean is_evdev);
typedef enum { typedef enum {
META_WAYLAND_KEYBOARD_SKIP_XCLIENTS = 1, META_WAYLAND_KEYBOARD_SKIP_XCLIENTS = 1,

View File

@ -257,8 +257,7 @@ pointer_constrain_callback (ClutterInputDevice *device,
} }
void void
meta_wayland_pointer_init (MetaWaylandPointer *pointer, meta_wayland_pointer_init (MetaWaylandPointer *pointer)
gboolean is_native)
{ {
ClutterDeviceManager *manager; ClutterDeviceManager *manager;
ClutterInputDevice *device; ClutterInputDevice *device;
@ -274,9 +273,16 @@ meta_wayland_pointer_init (MetaWaylandPointer *pointer,
manager = clutter_device_manager_get_default (); manager = clutter_device_manager_get_default ();
device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE); device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE);
if (is_native) #if defined(CLUTTER_WINDOWING_EGL)
clutter_evdev_set_pointer_constrain_callback (manager, pointer_constrain_callback, /* XXX -- the evdev backend can be used regardless of the
pointer, NULL); * windowing backend. To do this properly we need a Clutter
* API to check the input backend. */
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_EGL))
{
clutter_evdev_set_pointer_constrain_callback (manager, pointer_constrain_callback,
pointer, NULL);
}
#endif
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);

View File

@ -67,8 +67,7 @@ struct _MetaWaylandPointer
}; };
void void
meta_wayland_pointer_init (MetaWaylandPointer *pointer, meta_wayland_pointer_init (MetaWaylandPointer *pointer);
gboolean is_native);
void void
meta_wayland_pointer_release (MetaWaylandPointer *pointer); meta_wayland_pointer_release (MetaWaylandPointer *pointer);

View File

@ -204,8 +204,7 @@ pointer_handle_cursor_surface_destroy (struct wl_listener *listener, void *data)
} }
MetaWaylandSeat * MetaWaylandSeat *
meta_wayland_seat_new (struct wl_display *display, meta_wayland_seat_new (struct wl_display *display)
gboolean is_native)
{ {
MetaWaylandSeat *seat = g_new0 (MetaWaylandSeat, 1); MetaWaylandSeat *seat = g_new0 (MetaWaylandSeat, 1);
@ -213,9 +212,8 @@ meta_wayland_seat_new (struct wl_display *display,
wl_list_init (&seat->base_resource_list); wl_list_init (&seat->base_resource_list);
wl_list_init (&seat->data_device_resource_list); wl_list_init (&seat->data_device_resource_list);
meta_wayland_pointer_init (&seat->pointer, is_native); meta_wayland_pointer_init (&seat->pointer);
meta_wayland_keyboard_init (&seat->keyboard, display);
meta_wayland_keyboard_init (&seat->keyboard, display, is_native);
seat->display = display; seat->display = display;

View File

@ -74,8 +74,7 @@ struct _MetaWaylandSeat
}; };
MetaWaylandSeat * MetaWaylandSeat *
meta_wayland_seat_new (struct wl_display *display, meta_wayland_seat_new (struct wl_display *display);
gboolean is_native);
void void
meta_wayland_seat_update_pointer (MetaWaylandSeat *seat, meta_wayland_seat_update_pointer (MetaWaylandSeat *seat,

View File

@ -698,7 +698,7 @@ meta_wayland_init (void)
meta_wayland_data_device_manager_init (compositor->wayland_display); meta_wayland_data_device_manager_init (compositor->wayland_display);
compositor->seat = meta_wayland_seat_new (compositor->wayland_display, compositor->native); compositor->seat = meta_wayland_seat_new (compositor->wayland_display);
meta_wayland_init_shell (compositor); meta_wayland_init_shell (compositor);