summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2012-10-05 13:46:35 +0000
committerSebastian Dransfeld <sd@tango.flipp.net>2012-10-05 13:46:35 +0000
commita91fd04eade8c0e9fdd67264f5a09a7e6d6c40a2 (patch)
tree4b87af4e7f80ca0324f475aad9dcde0771374cba /legacy
parent433803e3dc055763a554fcc91ea36dabfac4575e (diff)
ecore_wayland: Use correct modifier flags
Events should use ECORE_EVENT_MODIFER_* flags... SVN revision: 77534
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c
index ccb4e5b002..80e0b45424 100644
--- a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c
@@ -77,6 +77,8 @@ static void _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Wind
77static void _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp); 77static void _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp);
78static void _ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int value, unsigned int timestamp); 78static void _ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int value, unsigned int timestamp);
79 79
80static unsigned int _ecore_wl_event_modifiers(unsigned int state);
81
80/* static int _ecore_wl_input_keysym_to_string(unsigned int symbol, char *buffer, int len); */ 82/* static int _ecore_wl_input_keysym_to_string(unsigned int symbol, char *buffer, int len); */
81 83
82/* wayland interfaces */ 84/* wayland interfaces */
@@ -595,7 +597,7 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard __UNUSE
595 e->window = win->id; 597 e->window = win->id;
596 e->event_window = win->id; 598 e->event_window = win->id;
597 e->timestamp = timestamp; 599 e->timestamp = timestamp;
598 e->modifiers = input->modifiers; 600 e->modifiers = _ecore_wl_event_modifiers(input->modifiers);
599 601
600 if (state) 602 if (state)
601 ecore_event_add(ECORE_EVENT_KEY_DOWN, e, NULL, NULL); 603 ecore_event_add(ECORE_EVENT_KEY_DOWN, e, NULL, NULL);
@@ -973,7 +975,7 @@ _ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, uns
973 ev->y = input->sy; 975 ev->y = input->sy;
974 /* ev->root.x = input->sx; */ 976 /* ev->root.x = input->sx; */
975 /* ev->root.y = input->sy; */ 977 /* ev->root.y = input->sy; */
976 ev->modifiers = input->modifiers; 978 ev->modifiers = _ecore_wl_event_modifiers(input->modifiers);
977 ev->multi.device = 0; 979 ev->multi.device = 0;
978 ev->multi.radius = 1; 980 ev->multi.radius = 1;
979 ev->multi.radius_x = 1; 981 ev->multi.radius_x = 1;
@@ -1005,7 +1007,7 @@ _ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsig
1005 ev->y = input->sy; 1007 ev->y = input->sy;
1006 /* ev->root.x = input->sx; */ 1008 /* ev->root.x = input->sx; */
1007 /* ev->root.y = input->sy; */ 1009 /* ev->root.y = input->sy; */
1008 ev->modifiers = input->modifiers; 1010 ev->modifiers = _ecore_wl_event_modifiers(input->modifiers);
1009 ev->timestamp = timestamp; 1011 ev->timestamp = timestamp;
1010 1012
1011 if (win) 1013 if (win)
@@ -1030,7 +1032,7 @@ _ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsi
1030 ev->y = input->sy; 1032 ev->y = input->sy;
1031 /* ev->root.x = input->sx; */ 1033 /* ev->root.x = input->sx; */
1032 /* ev->root.y = input->sy; */ 1034 /* ev->root.y = input->sy; */
1033 ev->modifiers = input->modifiers; 1035 ev->modifiers = _ecore_wl_event_modifiers(input->modifiers);
1034 ev->timestamp = timestamp; 1036 ev->timestamp = timestamp;
1035 1037
1036 if (win) 1038 if (win)
@@ -1091,7 +1093,7 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, uns
1091 ev->y = input->sy; 1093 ev->y = input->sy;
1092 /* ev->root.x = input->sx; */ 1094 /* ev->root.x = input->sx; */
1093 /* ev->root.y = input->sy; */ 1095 /* ev->root.y = input->sy; */
1094 ev->modifiers = input->modifiers; 1096 ev->modifiers = _ecore_wl_event_modifiers(input->modifiers);
1095 1097
1096 /* FIXME: Need to get these from wayland somehow */ 1098 /* FIXME: Need to get these from wayland somehow */
1097 ev->double_click = 0; 1099 ev->double_click = 0;
@@ -1138,7 +1140,7 @@ _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsig
1138 ev->y = input->sy; 1140 ev->y = input->sy;
1139 /* ev->root.x = input->sx; */ 1141 /* ev->root.x = input->sx; */
1140 /* ev->root.y = input->sy; */ 1142 /* ev->root.y = input->sy; */
1141 ev->modifiers = input->modifiers; 1143 ev->modifiers = _ecore_wl_event_modifiers(input->modifiers);
1142 1144
1143 /* FIXME: Need to get these from wayland somehow */ 1145 /* FIXME: Need to get these from wayland somehow */
1144 ev->double_click = 0; 1146 ev->double_click = 0;
@@ -1172,7 +1174,7 @@ _ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int v
1172 if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Wheel)))) return; 1174 if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Wheel)))) return;
1173 1175
1174 ev->timestamp = timestamp; 1176 ev->timestamp = timestamp;
1175 ev->modifiers = input->modifiers; 1177 ev->modifiers = _ecore_wl_event_modifiers(input->modifiers);
1176 ev->x = input->sx; 1178 ev->x = input->sx;
1177 ev->y = input->sy; 1179 ev->y = input->sy;
1178 /* ev->root.x = input->sx; */ 1180 /* ev->root.x = input->sx; */
@@ -1203,8 +1205,24 @@ _ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int v
1203 ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL); 1205 ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL);
1204} 1206}
1205 1207
1208static unsigned int
1209_ecore_wl_event_modifiers(unsigned int state)
1210{
1211 unsigned int modifiers = 0;
1212
1213 if (state & MOD_SHIFT_MASK)
1214 modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
1215
1216 if (state & MOD_CONTROL_MASK)
1217 modifiers |= ECORE_EVENT_MODIFIER_CTRL;
1218
1219 if (state & MOD_ALT_MASK)
1220 modifiers |= ECORE_EVENT_MODIFIER_ALT;
1221}
1222
1206void 1223void
1207_ecore_wl_input_set_selection(Ecore_Wl_Input *input, struct wl_data_source *source) 1224_ecore_wl_input_set_selection(Ecore_Wl_Input *input, struct wl_data_source *source)
1208{ 1225{
1209 wl_data_device_set_selection(input->data_device, source, input->display->serial); 1226 wl_data_device_set_selection(input->data_device, source, input->display->serial);
1210} 1227}
1228