x11: Remove xkb feature from x11-input
authorJaehoon Jeong <jh01.j@samsung.com>
Tue, 6 Oct 2015 09:11:09 +0000 (18:11 +0900)
committerTaekyun Kim <tkq.kim@samsung.com>
Wed, 7 Oct 2015 05:28:59 +0000 (14:28 +0900)
Change-Id: I5cc682e8786afc63a965a408773fa07cea5ef05d

configure.ac
src/lib/x11/x11-input.c
src/lib/x11/x11-internal.h

index d63de54..5f4387b 100644 (file)
@@ -135,7 +135,7 @@ AC_ARG_ENABLE(x11,
 AM_CONDITIONAL(ENABLE_X11, test x$enable_x11 = xyes)
 
 if test x$enable_x11 = xyes; then
-    PEPPER_X11_REQUIRES="x11 xcb-shm x11-xcb xkbcommon xkbcommon-x11"
+    PEPPER_X11_REQUIRES="x11 xcb-shm x11-xcb"
     PKG_CHECK_MODULES(PEPPER_X11, [$PEPPER_X11_REQUIRES])
     PEPPER_X11_REQUIRES="$PEPPER_X11_REQUIRES pepper pepper-render"
 
index 2a21039..347f6db 100644 (file)
@@ -46,7 +46,7 @@ x11_handle_input_event(x11_seat_t* seat, uint32_t type, xcb_generic_event_t* xev
 
             event.id    = PEPPER_EVENT_KEYBOARD_KEY;
             event.time  = kp->time;
-            event.key   = xkb_state_key_get_one_sym(seat->xkb_state, kp->detail);
+            event.key   = kp->detail - 8;
             event.state = PEPPER_KEY_STATE_PRESSED;
 
             pepper_object_emit_event((pepper_object_t *)seat->keyboard,
@@ -59,7 +59,7 @@ x11_handle_input_event(x11_seat_t* seat, uint32_t type, xcb_generic_event_t* xev
 
             event.id    = PEPPER_EVENT_KEYBOARD_KEY;
             event.time  = kr->time;
-            event.key   = xkb_state_key_get_one_sym(seat->xkb_state, kr->detail);
+            event.key   = kr->detail - 8;
             event.state = PEPPER_KEY_STATE_RELEASED;
 
             pepper_object_emit_event((pepper_object_t *)seat->keyboard,
@@ -146,15 +146,6 @@ x11_seat_destroy(void *data)
     if (seat->conn)
         seat->conn->seat = NULL;
 
-    if (seat->xkb_state)
-        xkb_state_unref(seat->xkb_state);
-
-    if (seat->keymap)
-        xkb_keymap_unref(seat->keymap);
-
-    if (seat->xkb_ctx)
-        xkb_context_unref(seat->xkb_ctx);
-
     free(seat);
 }
 
@@ -187,42 +178,6 @@ pepper_x11_input_create(pepper_x11_connection_t* conn)
 
     seat->id = X11_BACKEND_INPUT_ID;
 
-    /* Init XKB extension */
-    seat->xkb_ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
-    if (!seat->xkb_ctx)
-    {
-        PEPPER_ERROR("xkb_context_new failed\n");
-
-        goto failed;
-    }
-
-    seat->device_id = xkb_x11_get_core_keyboard_device_id(conn->xcb_connection);
-    if (seat->device_id == -1)
-    {
-        PEPPER_ERROR("xkb_x11_get_core_keyboard_device_id failed\n");
-
-        goto failed;
-    }
-
-    seat->keymap = xkb_x11_keymap_new_from_device(seat->xkb_ctx,
-                                                  conn->xcb_connection,
-                                                  seat->device_id,
-                                                  XKB_KEYMAP_COMPILE_NO_FLAGS);
-    if (!seat->keymap)
-    {
-        PEPPER_ERROR("xkb_x11_keymap_new_from_device failed\n");
-
-        goto failed;
-    }
-
-    seat->xkb_state = xkb_x11_state_new_from_device(seat->keymap, conn->xcb_connection, seat->device_id);
-    if (!seat->xkb_state)
-    {
-        PEPPER_ERROR("xkb_x11_state_new_from_device failed\n");
-
-        goto failed;
-    }
-
     /* Hard-coded: */
     seat->pointer = pepper_input_device_create(conn->compositor, WL_SEAT_CAPABILITY_POINTER,
                                                NULL, NULL);
index 2427e2c..3db4373 100644 (file)
@@ -5,8 +5,6 @@
 
 #include <xcb/xcb.h>
 #include <xcb/shm.h>
-#include <xkbcommon/xkbcommon.h>
-#include <xkbcommon/xkbcommon-x11.h>
 #include <X11/Xlib.h>
 #include <X11/Xlib-xcb.h>
 #include <string.h>
@@ -75,11 +73,6 @@ struct x11_seat
     uint32_t                        caps;
     char                           *name;
 
-    struct xkb_context             *xkb_ctx;
-    int32_t                         device_id;
-    struct xkb_keymap              *keymap;
-    struct xkb_state               *xkb_state;
-
     pepper_list_t                   link;
 
     struct wl_listener              conn_destroy_listener;