summaryrefslogtreecommitdiff
path: root/src/lib/elput
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-10-03 13:25:03 -0400
committerChris Michael <cp.michael@samsung.com>2017-10-03 14:14:04 -0400
commitfa2faff41b0396917b7a1da98a9f262cffc82723 (patch)
treeb7fa298679d056daa9e0bcea26009e1b0dcdac36 /src/lib/elput
parent11e92cdc863c590ab426acf09ab720fe0e36253c (diff)
elput: Fix issue of pointer rotation not being set on startup
elput_input_pointer_rotation_set may be getting called before input devices are actually added, so we need to be able to set pointer rotation when a device actually gets added. To fix this, we will store the requested input rotation value, and apply it at the time of input device creation. NB: The current case is that the wl_drm module will apply existing output rotation before Input has completely initialized, thus any calls to set the pointer rotation there will not succeed as input devices have not been created yet. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/elput')
-rw-r--r--src/lib/elput/elput_input.c38
-rw-r--r--src/lib/elput/elput_private.h1
2 files changed, 37 insertions, 2 deletions
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index d219eff9ff..ed6f3f322d 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -217,12 +217,44 @@ _device_add(Elput_Manager *em, struct libinput_device *dev)
217 eseat->devices = eina_list_append(eseat->devices, edev); 217 eseat->devices = eina_list_append(eseat->devices, edev);
218 218
219 DBG("Input Device Added: %s", libinput_device_get_name(dev)); 219 DBG("Input Device Added: %s", libinput_device_get_name(dev));
220
220 if (edev->caps & ELPUT_DEVICE_CAPS_KEYBOARD) 221 if (edev->caps & ELPUT_DEVICE_CAPS_KEYBOARD)
221 DBG("\tDevice added as Keyboard device"); 222 DBG("\tDevice added as Keyboard device");
223
222 if (edev->caps & ELPUT_DEVICE_CAPS_POINTER) 224 if (edev->caps & ELPUT_DEVICE_CAPS_POINTER)
223 DBG("\tDevice added as Pointer device"); 225 {
226 DBG("\tDevice added as Pointer device");
227 switch (em->input.rotation)
228 {
229 case 0:
230 edev->swap = EINA_FALSE;
231 edev->invert_x = EINA_FALSE;
232 edev->invert_y = EINA_FALSE;
233 break;
234 case 90:
235 edev->swap = EINA_TRUE;
236 edev->invert_x = EINA_FALSE;
237 edev->invert_y = EINA_TRUE;
238 break;
239 case 180:
240 edev->swap = EINA_FALSE;
241 edev->invert_x = EINA_TRUE;
242 edev->invert_y = EINA_TRUE;
243 break;
244 case 270:
245 edev->swap = EINA_TRUE;
246 edev->invert_x = EINA_TRUE;
247 edev->invert_y = EINA_FALSE;
248 break;
249 default:
250 break;
251 }
252 }
253
224 if (edev->caps & ELPUT_DEVICE_CAPS_TOUCH) 254 if (edev->caps & ELPUT_DEVICE_CAPS_TOUCH)
225 DBG("\tDevice added as Touch device"); 255 {
256 DBG("\tDevice added as Touch device");
257 }
226 258
227 _device_event_send(edev, ELPUT_DEVICE_ADDED); 259 _device_event_send(edev, ELPUT_DEVICE_ADDED);
228} 260}
@@ -578,6 +610,8 @@ elput_input_pointer_rotation_set(Elput_Manager *manager, int rotation)
578 if ((rotation % 90 != 0) || (rotation / 90 > 3) || (rotation < 0)) 610 if ((rotation % 90 != 0) || (rotation / 90 > 3) || (rotation < 0))
579 return EINA_FALSE; 611 return EINA_FALSE;
580 612
613 manager->input.rotation = rotation;
614
581 EINA_LIST_FOREACH(manager->input.seats, l, eseat) 615 EINA_LIST_FOREACH(manager->input.seats, l, eseat)
582 { 616 {
583 EINA_LIST_FOREACH(eseat->devices, ll, edev) 617 EINA_LIST_FOREACH(eseat->devices, ll, edev)
diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h
index a4ea37b8a1..692dd4a83e 100644
--- a/src/lib/elput/elput_private.h
+++ b/src/lib/elput/elput_private.h
@@ -82,6 +82,7 @@ typedef struct _Elput_Input
82 Eldbus_Pending *current_pending; 82 Eldbus_Pending *current_pending;
83 int pipe; 83 int pipe;
84 int pointer_w, pointer_h; 84 int pointer_w, pointer_h;
85 int rotation;
85 86
86 Eina_Bool suspended : 1; 87 Eina_Bool suspended : 1;
87} Elput_Input; 88} Elput_Input;