Fix bug that setting-UG can't be opened.
authorhhh.kwon <hhh.kwon@samsung.com>
Tue, 20 Nov 2012 03:43:54 +0000 (12:43 +0900)
committerhhh.kwon <hhh.kwon@samsung.com>
Tue, 20 Nov 2012 03:43:54 +0000 (12:43 +0900)
src/_button.c

index bc37b56..d0ed4a3 100755 (executable)
@@ -97,9 +97,6 @@ ui_gadget_h create_button_ug(void *data)
        utilx_set_window_opaque_state(ecore_x_display_get(), elm_win_xwindow_get(ad->win), UTILX_OPAQUE_STATE_ON);
        ug = ug_create(NULL, "setting-profile-efl", UG_MODE_FULLVIEW, NULL, &cbs);
 
-       ecore_x_e_illume_quickpanel_state_send(ecore_x_e_illume_zone_get(elm_win_xwindow_get(ad->win)),
-               ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
-
        return ug;
 }
 
@@ -114,11 +111,18 @@ int _open_ug(void *data)
        UG_INIT_EFL(ad->win, UG_OPT_INDICATOR_PORTRAIT_ONLY);
        elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
        ug = create_button_ug(ad);
-       _ungrab_key(ad);
-
-       retvm_if(ug == NULL, -1, "Failed to Create ug!\n");
+       if(ug!=NULL){
+               ecore_x_e_illume_quickpanel_state_send(ecore_x_e_illume_zone_get(elm_win_xwindow_get(ad->win)),
+                       ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
+               _ungrab_key(ad);
+       }
+       else{
+               ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NOTIFICATION);
+               utilx_set_window_opaque_state(ecore_x_display_get(), elm_win_xwindow_get(ad->win), UTILX_OPAQUE_STATE_OFF);
+               elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_HIDE);
+               return -1;
+       }
 
        ad->ug = ug;
-
        return 0;
 }