ecore-evas-drm: Fix issue of fullscreen surfaces not getting focus on show
authorChris Michael <cp.michael@samsung.com>
Tue, 21 Apr 2015 17:42:25 +0000 (13:42 -0400)
committerChris Michael <cp.michael@samsung.com>
Tue, 21 Apr 2015 17:44:36 +0000 (13:44 -0400)
Summary: This fixed T2349 where elm apps would not get initial focus
on show when running via drm. This also addresses the issue of always
sending the state_change event even when not an override.

NB: Thanks to bu5hm4n for reporting ... and even providing a potential fix ;)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/modules/ecore_evas/engines/drm/ecore_evas_drm.c

index d602f4719425be601ad97e18d094c449fd63c223..6ee365994456d31b136bd4c90f4cd2ff837983a1 100644 (file)
@@ -698,10 +698,26 @@ static void
 _ecore_evas_drm_show(Ecore_Evas *ee)
 {
    if ((!ee) || (ee->visible)) return;
-   evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
-   ee->prop.withdrawn = EINA_FALSE;
-   if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
+
+   ee->should_be_visible = 1;
+
+   if (ee->prop.avoid_damage)
+     _ecore_evas_drm_render(ee);
+
+   if (ee->prop.override)
+     {
+        ee->prop.withdrawn = EINA_FALSE;
+        if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
+     }
+
+   if (ee->visible) return;
+
    ee->visible = 1;
+   if (ee->prop.fullscreen)
+     {
+        evas_focus_in(ee->evas);
+        if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
+     }
    if (ee->func.fn_show) ee->func.fn_show(ee);
 }
 
@@ -709,11 +725,18 @@ static void
 _ecore_evas_drm_hide(Ecore_Evas *ee)
 {
    if ((!ee) || (!ee->visible)) return;
-   evas_sync(ee->evas);
-   ee->prop.withdrawn = EINA_TRUE;
-   if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
+
+   if (ee->prop.override)
+     {
+        ee->prop.withdrawn = EINA_TRUE;
+        if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
+     }
+
+   if (!ee->visible) return;
+
    ee->visible = 0;
    ee->should_be_visible = 0;
+   evas_sync(ee->evas);
    if (ee->func.fn_hide) ee->func.fn_hide(ee);
 }