#include <pkgmgr-info.h>
#include <aul_app_com.h>
#include <aul_screen_connector.h>
+#include <Ecore_Wayland.h>
#define API __attribute__((visibility("default")))
static int __is_dead_signal_connected;
static aul_app_com_connection_h __conn_dead_signal;
static unsigned int __watch_rid;
+static bool __manual_render;
+static bool __iconified = false;
+static bool __is_binded = false;
static GList *__dead_cbs;
struct dead_cb_s {
};
GQueue *__pending_queue;
+static int __change_viewer_visibility(bool visible);
static void __process_pending_status(int status, unsigned int surf)
{
__default_height = h;
}
+static Eina_Bool __iconify_state_changed(void *data, int type, void *event)
+{
+ Evas *evas = evas_object_evas_get(__win);
+ Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas);
+ Ecore_Wl_Event_Window_Iconify_State_Change *ev =
+ (Ecore_Wl_Event_Window_Iconify_State_Change *)event;
+
+ LOGI("Iconify state changed, %d, %d", ev->iconified, EINA_TRUE);
+ if (ev->iconified == EINA_FALSE && __iconified && !__is_binded) {
+ __change_viewer_visibility(true);
+ ecore_evas_manual_render_set(ee, EINA_TRUE);
+ screen_connector_toolkit_evas_send_visibility(__win,
+ VISIBILITY_TYPE_UNOBSCURED);
+ __manual_render = true;
+ __iconified = false;
+ LOGI("Manual render true");
+ } else if (ev->iconified == EINA_TRUE){
+ __iconified = true;
+ }
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
static int __watch_viewer_init(Evas_Object *win)
{
if (__watch_viewer_initialized)
__win_resized(NULL, NULL, win, NULL); /* init */
evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, __win_resized, NULL);
-
+ ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_ICONIFY_STATE_CHANGE,
+ __iconify_state_changed, NULL);
+ __manual_render = false;
__watch_viewer_initialized = 1;
return 0;
evas_object_data_set(__win, "tbm,watch", NULL);
}
-static void __screen_connector_toolkit_evas_updated_cb(const char *appid, const char *instance_id, int pid,
+static void __screen_connector_toolkit_evas_updated_cb(
+ const char *appid, const char *instance_id, int pid,
Evas_Object *image, void *data)
{
- evas_object_smart_callback_call(__win, WATCH_SMART_SIGNAL_UPDATED, image);
+ Evas *evas;
+ Ecore_Evas *ee;
+
+ evas_object_smart_callback_call(
+ __win, WATCH_SMART_SIGNAL_UPDATED, image);
+ if (__manual_render) {
+ __manual_render = false;
+ evas = evas_object_evas_get(__win);
+ ee = ecore_evas_ecore_evas_get(evas);
+ ecore_evas_manual_render_set(ee, EINA_FALSE);
+ LOGI("set manual false");
+ } else {
+ LOGI("updated");
+ }
}
API int watch_manager_set_resource_id(int resource_id)
if (!__toolkit || !win)
return -1;
+ LOGI("Bind");
+ __is_binded = true;
+
return screen_connector_toolkit_evas_bind(__toolkit, win);
}
if (!__toolkit)
return -1;
+ LOGI("Unbind");
+ __is_binded = false;
+
return screen_connector_toolkit_evas_unbind(__toolkit);
}