INCLUDE(FindPkgConfig)
IF("${_TV_PRODUCT}" STREQUAL "TRUE")
pkg_check_modules(pkgs REQUIRED
- aul capi-appfw-application capi-appfw-app-manager capi-base-common capi-media-audio-io capi-media-sound-manager
+ aul capi-appfw-application capi-appfw-app-manager capi-base-common capi-media-audio-io capi-media-sound-manager ecore-wayland
capi-network-bluetooth capi-system-info cynara-client cynara-session dbus-1 db-util dlog ecore glib-2.0 json-glib-1.0 libtzplatform-config libxml-2.0 sqlite3 vconf #msfapi
)
ELSE()
pkg_check_modules(pkgs REQUIRED
- aul capi-appfw-application capi-appfw-app-manager capi-base-common capi-media-audio-io capi-media-sound-manager
+ aul capi-appfw-application capi-appfw-app-manager capi-base-common capi-media-audio-io capi-media-sound-manager ecore-wayland
capi-system-info cynara-client cynara-session dbus-1 db-util dlog ecore glib-2.0 json-glib-1.0 libtzplatform-config libxml-2.0 sqlite3 vconf
)
ENDIF()
* limitations under the License.
*/
+#include <aul.h>
+#include <Ecore_Wayland.h>
#include "vc_cmd_db.h"
#include "vc_command.h"
#include "vc_config_mgr.h"
return VC_ERROR_NONE;
}
+static Eina_Bool __focus_changed_cb(void *data, int type, void *event)
+{
+ SLOG(LOG_DEBUG, TAG_VCW, "===== Focus changed");
+
+ int ret;
+ if (ECORE_WL_EVENT_FOCUS_IN == type) {
+ SLOG(LOG_DEBUG, TAG_VCW, "===== Set foreground");
+ ret = vc_widget_dbus_set_foreground(getpid(), true);
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to set foreground (true) : %d", ret);
+ }
+ } else if (ECORE_WL_EVENT_FOCUS_OUT == type) {
+ SLOG(LOG_DEBUG, TAG_VCW, "===== Set background");
+ ret = vc_widget_dbus_set_foreground(getpid(), false);
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to set foreground (false) : %d", ret);
+ }
+ } else {
+ SLOG(LOG_DEBUG, TAG_VCW, "===== type(%d) is NOT valid", type);
+ }
+
+ SLOG(LOG_DEBUG, TAG_VCW, "=====");
+ SLOG(LOG_DEBUG, TAG_VCW, "");
+
+ return ECORE_CALLBACK_RENEW;
+}
+
static Eina_Bool __vc_widget_connect_daemon(void *data)
{
/* Send hello */
vc_widget_client_set_service_state(g_vc_w, (vc_service_state_e)service_state);
+ ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN, __focus_changed_cb, NULL);
+ ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT, __focus_changed_cb, NULL);
+
+ char appid[255] = {'\0',};
+ aul_app_get_appid_bypid(getpid(), appid, sizeof(appid));
+
+ int status = aul_app_get_status(appid);
+ if (status == STATUS_FOCUS) {
+ SLOG(LOG_DEBUG, TAG_VCW, "===== Set foreground");
+ ret = vc_widget_dbus_set_foreground(getpid(), true);
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_VCW, "[ERROR] Fail to set foreground (true) : %d", ret);
+ }
+ }
+
vc_widget_client_set_state(g_vc_w, VC_STATE_READY);
ecore_timer_add(0, __vc_widget_notify_state_changed, g_vc_w);
SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Current state is not ready");
return VCD_ERROR_INVALID_STATE;
}
- if (-1 != vcd_client_manager_get_pid()) {
+ if (-1 == vcd_client_manager_get_pid()) {
SLOG(LOG_DEBUG, TAG_VCD, "[Server] Manager is NOT available.");
return VCD_ERROR_OPERATION_FAILED;
}
SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Current state is not recording");
return VCD_ERROR_INVALID_STATE;
}
- if (-1 != vcd_client_manager_get_pid()) {
+ if (-1 == vcd_client_manager_get_pid()) {
SLOG(LOG_DEBUG, TAG_VCD, "[Server] Manager is NOT available.");
return VCD_ERROR_OPERATION_FAILED;
}
SLOG(LOG_WARN, TAG_VCD, "[Server ERROR] Current state is not recording or processing");
return VCD_ERROR_INVALID_STATE;
}
- if (-1 != vcd_client_manager_get_pid()) {
+ if (-1 == vcd_client_manager_get_pid()) {
SLOG(LOG_DEBUG, TAG_VCD, "[Server] Manager is NOT available.");
return VCD_ERROR_OPERATION_FAILED;
}