summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>2014-03-28 15:28:50 +0900
committerMasayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>2014-03-28 15:43:22 +0900
commit851c876cda3d5dd4ea82a818dd78fc67f6b27007 (patch)
tree8b56f8301ae76d2f2935001afb18b738e4c3f911
parent7a6f8485b86d7d9a09b9d0bb21af529f3b3843f9 (diff)
downloadico-uxf-weston-plugin-tizen_ivi_panda.tar.gz
ico-uxf-weston-plugin-tizen_ivi_panda.tar.bz2
ico-uxf-weston-plugin-tizen_ivi_panda.zip
bug fix: TIVI-2953 - Don't call callback when destroy surface. Change-Id: I777d0d7100221ed815160e9124a6518684dac459 Signed-off-by: Masayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>
-rw-r--r--packaging/ico-uxf-weston-plugin.changes4
-rw-r--r--settings/weston.ini6
-rw-r--r--src/ico_ivi_common_private.h1
-rw-r--r--src/ico_plugin_version.h2
-rw-r--r--src/ico_window_animation.c18
-rw-r--r--src/ico_window_mgr.c58
-rw-r--r--src/ico_window_mgr_private.h9
7 files changed, 52 insertions, 46 deletions
diff --git a/packaging/ico-uxf-weston-plugin.changes b/packaging/ico-uxf-weston-plugin.changes
index e82fa37..64b903c 100644
--- a/packaging/ico-uxf-weston-plugin.changes
+++ b/packaging/ico-uxf-weston-plugin.changes
@@ -1,3 +1,7 @@
+* Fri Mar 28 2014 Shibata Makoto <shibata@mac.tec.toyota.co.jp> accepted/tizen/ivi/panda/20140326.234219@9f2534a
+- It follows in footsteps of change of weston-ivi-shell 0.1.3.
+- bug fix: TIVI-2953 - Don't call callback when destroy surface.
+
* Wed Mar 26 2014 Shibata Makoto <shibata@mac.tec.toyota.co.jp> accepted/tizen/ivi/release/20140312.121542@98097de
- bug fix: A setup to surface for "no animation" does not function normally.
- Test tool The name of test_send_input is changed into ico_send_inputevent.
diff --git a/settings/weston.ini b/settings/weston.ini
index 8b6ce12..590c0a3 100644
--- a/settings/weston.ini
+++ b/settings/weston.ini
@@ -1,6 +1,6 @@
[core]
modules=ico_plugin_loader.so
-shell=
+shell=ivi-shell.so
[shell]
num-workspaces=1
@@ -76,7 +76,7 @@ name=UNKNOWN1
transform=90
[ivi-plugin]
-modules=ivi-shell.so,ivi-shell-ext.so,ivi-controller.so,ico_window_mgr.so,ico_window_animation.so,ico_input_mgr.so
+modules=ivi-controller.so,ico_window_mgr.so,ico_window_animation.so,ico_input_mgr.so
[ivi-display]
# logical display number list
@@ -87,8 +87,6 @@ displayno=1,0
default=fade
# default animation time(ms)
time=500
-# default animation frame rate(frame/sec)
-fps=30
[ivi-option]
# option flags (but not used)
diff --git a/src/ico_ivi_common_private.h b/src/ico_ivi_common_private.h
index 497f0c2..1d2174c 100644
--- a/src/ico_ivi_common_private.h
+++ b/src/ico_ivi_common_private.h
@@ -79,7 +79,6 @@ int ico_ivi_debugflag(void); /* Get debug flag
/* Get default animation name */
const char *ico_ivi_default_animation_name(void);
int ico_ivi_default_animation_time(void); /* Get default animation time(ms) */
-int ico_ivi_default_animation_fps(void); /* Get animation frame rate(fps) */
/* Debug Traces */
/* Define for debug write */
diff --git a/src/ico_plugin_version.h b/src/ico_plugin_version.h
index fb5c623..d7d1daf 100644
--- a/src/ico_plugin_version.h
+++ b/src/ico_plugin_version.h
@@ -1 +1 @@
-#define ICO_PLUIGN_VERSION "0.9.21 (Mar-26-2014)"
+#define ICO_PLUIGN_VERSION "0.9.21 (Mar-28-2014)"
diff --git a/src/ico_window_animation.c b/src/ico_window_animation.c
index 0489486..934483c 100644
--- a/src/ico_window_animation.c
+++ b/src/ico_window_animation.c
@@ -79,9 +79,7 @@ struct animation_data {
/* static valiables */
static struct weston_compositor *weston_ec; /* Weston compositor */
static char *default_animation; /* default animation name */
-static int animation_fps; /* animation frame rate(frame/sec) */
static int animation_time; /* default animation time(ms) */
-static int animation_count; /* current number of animations */
static struct animation_data *free_data; /* free data list */
/* support animation names */
@@ -211,7 +209,6 @@ ico_window_animation(const int op, void *data)
struct weston_output, link);
wl_list_insert(output->animation_list.prev,
&usurf->animation.animation.link);
- animation_count ++;
}
}
else if (((usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_SHOW) &&
@@ -416,17 +413,15 @@ animation_cont(struct weston_animation *animation, struct weston_output *output,
if (usurf->animation.time == 0) {
usurf->animation.time = animation_time;
}
- if (((output == NULL) && (msecs == 0)) || (nowsec >= ((uint32_t)usurf->animation.time))) {
+ if (((output == NULL) && (msecs == 0)) ||
+ (nowsec >= ((uint32_t)usurf->animation.time))) {
par = 100;
}
else {
par = (nowsec * 100 + usurf->animation.time / 2) / usurf->animation.time;
- if (par < 2) par = 2;
+ if (par < 1) par = 1;
}
- if ((par >= 100) ||
- (abs(usurf->animation.current - par) >=
- (((1000 * 100) / animation_fps) / usurf->animation.time)) ||
- ((animation_count > 1) && (par != usurf->animation.current))) {
+ if ((par >= 100) || (par != usurf->animation.current)) {
usurf->animation.current = par;
return 0;
}
@@ -465,9 +460,6 @@ animation_end(struct uifw_win_surface *usurf, const int disp)
}
animadata = (struct animation_data *)usurf->animation.animadata;
- if (animation_count > 0) {
- animation_count --;
- }
ev = ico_ivi_get_primary_view(usurf);
if (animadata) {
@@ -1258,8 +1250,6 @@ module_init(struct weston_compositor *ec, int *argc, char *argv[])
weston_ec = ec;
default_animation = (char *)ico_ivi_default_animation_name();
animation_time = ico_ivi_default_animation_time();
- animation_fps = ico_ivi_default_animation_fps();
- animation_count = 0;
ico_window_mgr_set_hook_animation(ico_window_animation);
diff --git a/src/ico_window_mgr.c b/src/ico_window_mgr.c
index ffeac62..780a508 100644
--- a/src/ico_window_mgr.c
+++ b/src/ico_window_mgr.c
@@ -152,6 +152,8 @@ static void win_mgr_register_surface(uint32_t id_surface, struct weston_surface
struct weston_layout_surface *ivisurf);
/* surface destroy */
static void win_mgr_destroy_surface(struct weston_surface *surface);
+ /* weston_surface destroy listener */
+static void win_mgr_surface_destroy(struct wl_listener *listener, void *data);
/* read surface pixel */
static int win_mgr_takeSurfaceScreenshot(const char *filename,
struct uifw_win_surface *usurf,
@@ -232,7 +234,6 @@ static int _ico_ivi_option_flag = 0; /* option flags
static int _ico_ivi_debug_level = 3; /* debug Level */
static char *_ico_ivi_animation_name = NULL; /* default animation name */
static int _ico_ivi_animation_time = 500; /* default animation time */
-static int _ico_ivi_animation_fps = 30; /* animation frame rate */
/* static management table */
static struct ico_win_mgr *_ico_win_mgr = NULL;
@@ -319,20 +320,6 @@ ico_ivi_default_animation_time(void)
/*--------------------------------------------------------------------------*/
/**
- * @brief ico_ivi_default_animation_fps: get default animation frame rate
- *
- * @param None
- * @return Default animation frame rate(frames/sec)
- */
-/*--------------------------------------------------------------------------*/
-WL_EXPORT int
-ico_ivi_default_animation_fps(void)
-{
- return _ico_ivi_animation_fps;
-}
-
-/*--------------------------------------------------------------------------*/
-/**
* @brief ico_ivi_get_mynode: Get my NodeId
*
* @param None
@@ -571,7 +558,7 @@ ico_window_mgr_get_usurf(const uint32_t surfaceid)
}
usurf = usurf->next_idhash;
}
- uifw_trace("ico_window_mgr_get_usurf: NULL");
+ uifw_trace("ico_window_mgr_get_usurf: NULL(%08x)", surfaceid);
return NULL;
}
@@ -1398,9 +1385,9 @@ ico_ivi_surfacePropertyNotification(struct weston_layout_surface *ivisurf,
/* surface changed, send event to controller */
wl_list_for_each (mgr, &_ico_win_mgr->manager_list, link) {
uifw_trace("win_mgr_send_event: Send UPDATE_SURFACE(surf=%08x) "
- "v=%d src=%d/%d dest=%d/%d(%d/%d)", id_surface,
+ "v=%d src=%d/%d dest=%d/%d(%d/%d) mgr=%08x", id_surface,
usurf->visible, usurf->client_width, usurf->client_height,
- usurf->x, usurf->y, usurf->width, usurf->height);
+ usurf->x, usurf->y, usurf->width, usurf->height, (int)mgr);
ico_window_mgr_send_update_surface(mgr->resource, id_surface,
usurf->visible, usurf->client_width,
usurf->client_height, usurf->x, usurf->y,
@@ -1468,6 +1455,10 @@ win_mgr_register_surface(uint32_t id_surface, struct weston_surface *surface,
usurf->configure_width = usurf->client_width;
usurf->configure_height = usurf->client_height;
}
+ wl_list_init(&usurf->surface_destroy_listener.link);
+ usurf->surface_destroy_listener.notify = win_mgr_surface_destroy;
+ wl_signal_add(&surface->destroy_signal, &usurf->surface_destroy_listener);
+
wl_list_init(&usurf->client_link);
wl_list_init(&usurf->animation.animation.link);
wl_list_init(&usurf->surf_map);
@@ -2375,6 +2366,9 @@ win_mgr_destroy_surface(struct weston_surface *surface)
(*win_mgr_hook_animation)(ICO_WINDOW_MGR_ANIMATION_DESTROY, (void *)usurf);
}
+ /* remove destroy listener */
+ wl_list_remove(&usurf->surface_destroy_listener.link);
+
/* send destroy event to controller */
win_mgr_send_event(ICO_WINDOW_MGR_DESTROY_SURFACE, usurf->surfaceid, 0);
@@ -2416,6 +2410,28 @@ win_mgr_destroy_surface(struct weston_surface *surface)
/*--------------------------------------------------------------------------*/
/**
+ * @brief win_mgr_surface_destroy: weston_surface destroy listener
+ *
+ * @param[in] listener listener
+ * @param[in] data data (unused)
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+win_mgr_surface_destroy(struct wl_listener *listener, void *data)
+{
+ struct uifw_win_surface *usurf = container_of(listener, struct uifw_win_surface,
+ surface_destroy_listener);
+
+ uifw_trace("win_mgr_surface_destroy: Enter(%08x)", usurf->surfaceid);
+
+ win_mgr_destroy_surface(usurf->surface);
+
+ uifw_trace("win_mgr_surface_destroy: Leave");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
* @brief win_mgr_takeSurfaceScreenshot: take screen image pixel
*
* @param[in] filename output file path
@@ -2833,12 +2849,10 @@ module_init(struct weston_compositor *ec, int *argc, char *argv[])
if (section) {
weston_config_section_get_string(section, "default", &_ico_ivi_animation_name, NULL);
weston_config_section_get_int(section, "time", &_ico_ivi_animation_time, 500);
- weston_config_section_get_int(section, "fps", &_ico_ivi_animation_fps, 30);
}
if (_ico_ivi_animation_name == NULL)
_ico_ivi_animation_name = (char *)"fade";
if (_ico_ivi_animation_time < 100) _ico_ivi_animation_time = 500;
- if (_ico_ivi_animation_fps < 3) _ico_ivi_animation_fps = 30;
/* create ico_window_mgr management table */
_ico_win_mgr = (struct ico_win_mgr *)malloc(sizeof(struct ico_win_mgr));
@@ -2937,8 +2951,8 @@ module_init(struct weston_compositor *ec, int *argc, char *argv[])
wl_event_loop_add_timer(loop, win_mgr_timer_mapsurface, NULL);
wl_event_source_timer_update(_ico_win_mgr->wait_mapevent, 1000);
- uifw_info("ico_window_mgr: animation name=%s time=%d fps=%d",
- _ico_ivi_animation_name, _ico_ivi_animation_time, _ico_ivi_animation_fps);
+ uifw_info("ico_window_mgr: animation name=%s time=%d",
+ _ico_ivi_animation_name, _ico_ivi_animation_time);
uifw_info("ico_window_mgr: option flag=0x%04x log level=%d debug flag=0x%04x",
_ico_ivi_option_flag, _ico_ivi_debug_level & 0x0ffff,
(_ico_ivi_debug_level >> 16) & 0x0ffff);
diff --git a/src/ico_window_mgr_private.h b/src/ico_window_mgr_private.h
index 6e3aeff..90867e5 100644
--- a/src/ico_window_mgr_private.h
+++ b/src/ico_window_mgr_private.h
@@ -138,11 +138,12 @@ struct shell_surface;
struct weston_layout_surface;
struct uifw_win_surface {
uint32_t surfaceid; /* UIFW SurfaceId */
- struct uifw_node_table *node_tbl; /* Node manager of ico_window_mgr */
- struct weston_surface *surface; /* Weston surface */
+ struct uifw_node_table *node_tbl; /* Node manager of ico_window_mgr */
+ struct weston_surface *surface; /* Weston surface */
struct weston_layout_surface *ivisurf; /* Weston layout surface */
- struct uifw_client *uclient; /* Client */
- struct wl_resource *shsurf_resource; /* wl_shell_surface resource */
+ struct uifw_client *uclient; /* Client */
+ struct wl_resource *shsurf_resource; /* wl_shell_surface resource */
+ struct wl_listener surface_destroy_listener; /* destroy listener */
int x; /* X-coordinate */
int y; /* Y-coordinate */
uint16_t width; /* Width */