fix to launch homescreen eventhough gumd does not enabled 42/35742/2
authorSoohye Shin <soohye.shin@samsung.com>
Tue, 24 Feb 2015 07:19:28 +0000 (16:19 +0900)
committerSoohye Shin <soohye.shin@samsung.com>
Tue, 24 Feb 2015 08:10:53 +0000 (17:10 +0900)
Change-Id: I12774b9dc878232d45f96177713cfc8bb16604f2
Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
edje/bar/ubar.edc
src/engine.c
src/ubar.c

index a9dc6a0..c145a1c 100644 (file)
@@ -401,6 +401,12 @@ group {
                                        relative, 0.0 0.0;
                                }
                                color, 21 31 54 192;
+                               visible, 0;
+                       }
+                       description {
+                               state, "show" 0.0;
+                               inherit, "default" 0.0;
+                               visible, 1;
                        }
                }
                part {
@@ -453,6 +459,13 @@ group {
                        target, "clip";
                }
                program {
+                       name, "show.bar";
+                       signal, SIG_SHOW;
+                       source, SRC_PROG;
+                       action, STATE_SET "show" 0.0;
+                       target, "pad.left";
+               }
+               program {
                        name, "hide";
                        signal, SIG_HIDE;
                        source, SRC_PROG;
index ac2b74e..7003e34 100644 (file)
@@ -28,6 +28,7 @@
 #include <gum/common/gum-user-types.h>
 #include <Elementary.h>
 #include <cynara-client.h>
+#include <pwd.h>
 
 #include "engine.h"
 #include "bus.h"
@@ -591,6 +592,7 @@ static int _load_login_user(struct engine *eng, uid_t uid)
 {
        GumUser *user;
        const char *icon, *name;
+       struct passwd *passwd;
 
        if (!eng) {
                _ERR("Invalid argument");
@@ -600,6 +602,10 @@ static int _load_login_user(struct engine *eng, uid_t uid)
        user = gum_user_get_sync(uid, FALSE);
        if (!user) {
                _ERR("failed to get login user");
+               passwd = getpwuid(uid);
+               eng->user.name = strdup(passwd->pw_name ?
+                               passwd->pw_name : DEF_USER_NAME);
+               eng->user.thumb = strdup(DEF_USER_THUMB);
                return -1;
        }
 
@@ -640,7 +646,15 @@ static int _load_user(struct engine *eng)
        r = _load_login_user(eng, user_uid);
        if (r < 0) {
                _ERR("failed to load login user");
-               return -1;
+               return 0;
+       }
+
+       if (engine_ubar_item_get_privilege(eng)) {
+               it = _new_ubar_item(DEF_ADD_NAME, DEF_ADD_THUMB);
+               if (it) {
+                       it->eng = eng;
+                       eng->ubar_its = eina_list_append(eng->ubar_its, it);
+               }
        }
 
        service = gum_user_service_create_sync(FALSE);
@@ -679,14 +693,6 @@ static int _load_user(struct engine *eng)
                eng->ubar_its = eina_list_append(eng->ubar_its, it);
        }
 
-       if (engine_ubar_item_get_privilege(eng)) {
-               it = _new_ubar_item(DEF_ADD_NAME, DEF_ADD_THUMB);
-               if (it) {
-                       it->eng = eng;
-                       eng->ubar_its = eina_list_append(eng->ubar_its, it);
-               }
-       }
-
        gum_user_service_list_free(list);
        g_object_unref(service);
 
index 7fb08ae..be4aa0a 100644 (file)
@@ -236,9 +236,7 @@ static int _add_init_user(struct _ubar_data *bar, Evas_Object *base)
                return -1;
        }
        elm_object_part_content_set(ly, PART_USER_THUMB, ic);
-
        elm_object_part_content_set(base, PART_USER, ly);
-       elm_object_focus_allow_set(ly, EINA_TRUE);
 
        evas_object_event_callback_add(ly,
                        EVAS_CALLBACK_MOUSE_MOVE, _mouse_over, NULL);
@@ -614,7 +612,9 @@ static int _update_items(struct _ubar_data *bar, void *eng)
 
        _pack_arrow(bar, eina_list_count(bar->list));
 
+       elm_object_focus_allow_set(bar->user->eo, EINA_TRUE);
        evas_object_focus_set(bar->user->eo, EINA_TRUE);
+       elm_object_signal_emit(bar->ly, SIG_SHOW, SRC_PROG);
 
        return 0;
 }