mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
wayland: Remove is_native from seat
We can easily do this with a Clutter backend check instead...
This commit is contained in:
parent
f26de405dd
commit
304a525744
@ -201,13 +201,17 @@ meta_wayland_keyboard_take_keymap (MetaWaylandKeyboard *keyboard,
|
||||
strcpy (xkb_info->keymap_area, 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;
|
||||
|
||||
manager = clutter_device_manager_get_default ();
|
||||
clutter_evdev_set_keyboard_map (manager, xkb_info->keymap);
|
||||
}
|
||||
#endif
|
||||
|
||||
inform_clients_of_new_keymap (keyboard, flags);
|
||||
|
||||
@ -331,8 +335,7 @@ static MetaWaylandKeyboardGrabInterface modal_grab = {
|
||||
|
||||
gboolean
|
||||
meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard,
|
||||
struct wl_display *display,
|
||||
gboolean is_evdev)
|
||||
struct wl_display *display)
|
||||
{
|
||||
memset (keyboard, 0, sizeof *keyboard);
|
||||
keyboard->xkb_info.keymap_fd = -1;
|
||||
@ -347,7 +350,6 @@ meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard,
|
||||
keyboard->display = display;
|
||||
|
||||
keyboard->xkb_context = xkb_context_new (0 /* flags */);
|
||||
keyboard->is_evdev = is_evdev;
|
||||
|
||||
/* Compute a default until gnome-settings-daemon starts and sets
|
||||
the appropriate values
|
||||
|
@ -110,7 +110,6 @@ struct _MetaWaylandKeyboard
|
||||
struct wl_display *display;
|
||||
|
||||
struct xkb_context *xkb_context;
|
||||
gboolean is_evdev;
|
||||
MetaWaylandXkbInfo xkb_info;
|
||||
|
||||
MetaWaylandKeyboardGrab input_method_grab;
|
||||
@ -119,8 +118,7 @@ struct _MetaWaylandKeyboard
|
||||
|
||||
gboolean
|
||||
meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard,
|
||||
struct wl_display *display,
|
||||
gboolean is_evdev);
|
||||
struct wl_display *display);
|
||||
|
||||
typedef enum {
|
||||
META_WAYLAND_KEYBOARD_SKIP_XCLIENTS = 1,
|
||||
|
@ -257,8 +257,7 @@ pointer_constrain_callback (ClutterInputDevice *device,
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_pointer_init (MetaWaylandPointer *pointer,
|
||||
gboolean is_native)
|
||||
meta_wayland_pointer_init (MetaWaylandPointer *pointer)
|
||||
{
|
||||
ClutterDeviceManager *manager;
|
||||
ClutterInputDevice *device;
|
||||
@ -274,9 +273,16 @@ meta_wayland_pointer_init (MetaWaylandPointer *pointer,
|
||||
manager = clutter_device_manager_get_default ();
|
||||
device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE);
|
||||
|
||||
if (is_native)
|
||||
clutter_evdev_set_pointer_constrain_callback (manager, pointer_constrain_callback,
|
||||
pointer, NULL);
|
||||
#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))
|
||||
{
|
||||
clutter_evdev_set_pointer_constrain_callback (manager, pointer_constrain_callback,
|
||||
pointer, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
clutter_input_device_get_coords (device, NULL, ¤t);
|
||||
pointer->x = wl_fixed_from_double (current.x);
|
||||
|
@ -67,8 +67,7 @@ struct _MetaWaylandPointer
|
||||
};
|
||||
|
||||
void
|
||||
meta_wayland_pointer_init (MetaWaylandPointer *pointer,
|
||||
gboolean is_native);
|
||||
meta_wayland_pointer_init (MetaWaylandPointer *pointer);
|
||||
|
||||
void
|
||||
meta_wayland_pointer_release (MetaWaylandPointer *pointer);
|
||||
|
@ -204,8 +204,7 @@ pointer_handle_cursor_surface_destroy (struct wl_listener *listener, void *data)
|
||||
}
|
||||
|
||||
MetaWaylandSeat *
|
||||
meta_wayland_seat_new (struct wl_display *display,
|
||||
gboolean is_native)
|
||||
meta_wayland_seat_new (struct wl_display *display)
|
||||
{
|
||||
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->data_device_resource_list);
|
||||
|
||||
meta_wayland_pointer_init (&seat->pointer, is_native);
|
||||
|
||||
meta_wayland_keyboard_init (&seat->keyboard, display, is_native);
|
||||
meta_wayland_pointer_init (&seat->pointer);
|
||||
meta_wayland_keyboard_init (&seat->keyboard, display);
|
||||
|
||||
seat->display = display;
|
||||
|
||||
|
@ -74,8 +74,7 @@ struct _MetaWaylandSeat
|
||||
};
|
||||
|
||||
MetaWaylandSeat *
|
||||
meta_wayland_seat_new (struct wl_display *display,
|
||||
gboolean is_native);
|
||||
meta_wayland_seat_new (struct wl_display *display);
|
||||
|
||||
void
|
||||
meta_wayland_seat_update_pointer (MetaWaylandSeat *seat,
|
||||
|
@ -698,7 +698,7 @@ meta_wayland_init (void)
|
||||
|
||||
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user