summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-06-16 15:03:09 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-06-16 12:23:08 -0400
commitad0aae8f8d8bb1b13ea68ba2103b9e8f4608a2f0 (patch)
tree95d8273ba71b2ef46fd7b6aa42eae6d1734fa324
parentcad9d8fb55472830c9a981fa5a65fe8555caa1a3 (diff)
downloadefl-ad0aae8f8d8bb1b13ea68ba2103b9e8f4608a2f0.tar.gz
elput: remove keymap mmap+event
this was originally intended to allow some code to be moved out of the compositor, but the idea turned out to be unfeasible since multiple display backends need to be supported and not all related components will provide similar functionality
-rw-r--r--src/lib/elput/Elput.h8
-rw-r--r--src/lib/elput/elput_evdev.c77
-rw-r--r--src/lib/elput/elput_private.h3
3 files changed, 0 insertions, 88 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index c434a12859..b5145d7f81 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -73,13 +73,6 @@ typedef struct _Elput_Event_Seat_Frame
Elput_Seat *seat;
} Elput_Event_Seat_Frame;
-/* structure to represent event for seat keymap changes */
-typedef struct _Elput_Event_Keymap_Send
-{
- int fd, format;
- size_t size;
-} Elput_Event_Keymap_Send;
-
/* structure to represent event for seat modifiers changes */
typedef struct _Elput_Event_Modifiers_Send
{
@@ -122,7 +115,6 @@ typedef struct Elput_Event_Pointer_Motion
EAPI extern int ELPUT_EVENT_SEAT_CAPS;
EAPI extern int ELPUT_EVENT_SEAT_FRAME;
-EAPI extern int ELPUT_EVENT_KEYMAP_SEND;
EAPI extern int ELPUT_EVENT_MODIFIERS_SEND;
EAPI extern int ELPUT_EVENT_DEVICE_CHANGE;
EAPI extern int ELPUT_EVENT_SESSION_ACTIVE;
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index 4364d48c75..a03ec914e0 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -65,42 +65,10 @@ _keyboard_modifiers_update(Elput_Keyboard *kbd, Elput_Seat *seat)
seat->modifiers |= ECORE_EVENT_MODIFIER_ALTGR;
}
-static int
-_keyboard_fd_get(off_t size)
-{
- Eina_Tmpstr *fullname;
- int fd = 0;
- Efl_Vpath_File *file_obj;
-
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
- "(:run:)/elput-keymap-XXXXXX");
- fd = eina_file_mkstemp(efl_vpath_file_result_get(file_obj), &fullname);
- efl_del(file_obj);
-
- if (fd < 0) return -1;
-
- if (!eina_file_close_on_exec(fd, EINA_TRUE))
- {
- close(fd);
- return -1;
- }
-
- if (ftruncate(fd, size) < 0)
- {
- close(fd);
- return -1;
- }
-
- unlink(fullname);
- eina_tmpstr_del(fullname);
- return fd;
-}
-
static Elput_Keyboard_Info *
_keyboard_info_create(struct xkb_keymap *keymap)
{
Elput_Keyboard_Info *info;
- char *str;
info = calloc(1, sizeof(Elput_Keyboard_Info));
if (!info) return NULL;
@@ -121,32 +89,7 @@ _keyboard_info_create(struct xkb_keymap *keymap)
info->mods.altgr =
1 << xkb_keymap_mod_get_index(info->keymap.map, "ISO_Level3_Shift");
- str = xkb_keymap_get_as_string(info->keymap.map, XKB_KEYMAP_FORMAT_TEXT_V1);
- if (!str) goto err;
-
- info->keymap.size = strlen(str) + 1;
-
- info->keymap.fd = _keyboard_fd_get(info->keymap.size);
- if (info->keymap.fd < 0) goto err_fd;
-
- info->keymap.area =
- mmap(NULL, info->keymap.size, PROT_READ | PROT_WRITE,
- MAP_SHARED, info->keymap.fd, 0);
- if (info->keymap.area == MAP_FAILED) goto err_map;
-
- strcpy(info->keymap.area, str);
- free(str);
-
return info;
-
-err_map:
- close(info->keymap.fd);
-err_fd:
- free(str);
-err:
- xkb_keymap_unref(info->keymap.map);
- free(info);
- return NULL;
}
static void
@@ -156,9 +99,6 @@ _keyboard_info_destroy(Elput_Keyboard_Info *info)
xkb_keymap_unref(info->keymap.map);
- if (info->keymap.area) munmap(info->keymap.area, info->keymap.size);
- if (info->keymap.fd >= 0) close(info->keymap.fd);
-
free(info);
}
@@ -353,21 +293,6 @@ _keyboard_key_send(Elput_Device *dev, enum libinput_key_state state, const char
}
static void
-_keyboard_keymap_send(Elput_Keyboard_Info *info)
-{
- Elput_Event_Keymap_Send *ev;
-
- ev = calloc(1, sizeof(Elput_Event_Keymap_Send));
- if (!ev) return;
-
- ev->fd = info->keymap.fd;
- ev->size = info->keymap.size;
- ev->format = XKB_KEYMAP_FORMAT_TEXT_V1;
-
- ecore_event_add(ELPUT_EVENT_KEYMAP_SEND, ev, NULL, NULL);
-}
-
-static void
_keyboard_modifiers_send(Elput_Keyboard *kbd)
{
Elput_Event_Modifiers_Send *ev;
@@ -453,7 +378,6 @@ _keyboard_keymap_update(Elput_Seat *seat)
_keyboard_compose_init(kbd);
_keyboard_modifiers_update(kbd, seat);
- _keyboard_keymap_send(kbd->info);
if ((!latched) && (!locked)) return;
@@ -475,7 +399,6 @@ _keyboard_group_update(Elput_Seat *seat)
_keyboard_compose_init(kbd);
_keyboard_modifiers_update(kbd, seat);
- _keyboard_keymap_send(kbd->info);
if ((!latched) && (!locked)) return;
diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h
index 6b253d2fae..54ef2c2ba0 100644
--- a/src/lib/elput/elput_private.h
+++ b/src/lib/elput/elput_private.h
@@ -92,9 +92,6 @@ typedef struct _Elput_Keyboard_Info
struct
{
- int fd;
- size_t size;
- char *area;
struct xkb_keymap *map;
} keymap;