summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-02-26 00:28:47 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-02-26 00:36:17 +0900
commitcc1e1a5b5601a40d49f95922deee58a12b230afd (patch)
treeeffb510c934d302b9fe6e5c4534bc6e4a32281d6 /src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
parentd2d63a8c239cf40b7b828303cca34a0d0dde97ec (diff)
ecore evas - drm engine - fix focus set on show to work correctly
Diffstat (limited to '')
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index 3059d74a09..15851c0d56 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -63,6 +63,7 @@ typedef struct _Ecore_Evas_Engine_Drm_Data
63 Eina_Bool ticking : 1; 63 Eina_Bool ticking : 1;
64 Eina_Bool once : 1; 64 Eina_Bool once : 1;
65 Ecore_Job *tick_job; 65 Ecore_Job *tick_job;
66 Ecore_Job *focus_job;
66} Ecore_Evas_Engine_Drm_Data; 67} Ecore_Evas_Engine_Drm_Data;
67 68
68static int _drm_init_count = 0; 69static int _drm_init_count = 0;
@@ -198,6 +199,11 @@ _ecore_evas_drm_shutdown(Ecore_Evas_Engine_Drm_Data *edata)
198 Ecore_Event_Handler *h; 199 Ecore_Event_Handler *h;
199 if (--_drm_init_count != 0) return _drm_init_count; 200 if (--_drm_init_count != 0) return _drm_init_count;
200 201
202 if (edata->focus_job)
203 {
204 ecore_job_del(edata->focus_job);
205 edata->focus_job = NULL;
206 }
201 ecore_drm2_outputs_destroy(edata->dev); 207 ecore_drm2_outputs_destroy(edata->dev);
202 ecore_drm2_device_close(edata->dev); 208 ecore_drm2_device_close(edata->dev);
203 ecore_drm2_shutdown(); 209 ecore_drm2_shutdown();
@@ -383,6 +389,17 @@ _drm_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y)
383} 389}
384 390
385static void 391static void
392_drm_show_focus_job(void *data)
393{
394 Ecore_Evas *ee = data;
395 Ecore_Evas_Engine_Drm_Data *edata;
396
397 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
398 edata = ee->engine.data;
399 edata->focus_job = NULL;
400}
401
402static void
386_drm_show(Ecore_Evas *ee) 403_drm_show(Ecore_Evas *ee)
387{ 404{
388 Ecore_Evas_Engine_Drm_Data *edata; 405 Ecore_Evas_Engine_Drm_Data *edata;
@@ -406,14 +423,10 @@ _drm_show(Ecore_Evas *ee)
406 if (ee->visible) return; 423 if (ee->visible) return;
407 424
408 ee->visible = 1; 425 ee->visible = 1;
409 if (ee->prop.fullscreen)
410 {
411 evas_focus_in(ee->evas);
412 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
413 }
414 if (ee->func.fn_show) ee->func.fn_show(ee); 426 if (ee->func.fn_show) ee->func.fn_show(ee);
415 427
416 edata = ee->engine.data; 428 edata = ee->engine.data;
429 edata->focus_job = ecore_job_add(_drm_show_focus_job, ee);
417 /* HACK: sometimes we still have an animator ticking when we vc switch 430 /* HACK: sometimes we still have an animator ticking when we vc switch
418 * so for now we just fire off a flip here to kick it when we come back. 431 * so for now we just fire off a flip here to kick it when we come back.
419 * This is just papering over a bug for now until I have time to track 432 * This is just papering over a bug for now until I have time to track