summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ico_window_animation.c29
-rw-r--r--src/ico_window_mgr.c37
-rw-r--r--src/ico_window_mgr_private.h9
3 files changed, 54 insertions, 21 deletions
diff --git a/src/ico_window_animation.c b/src/ico_window_animation.c
index 5e49110..e227107 100644
--- a/src/ico_window_animation.c
+++ b/src/ico_window_animation.c
@@ -60,11 +60,6 @@
#define ANIMA_SWING_TOBOTTOM 33 /* SwingIn top to bottom/SwingOut bottom to top */
#define ANIMA_SWING_TOTOP 34 /* SwingIn bottom to top/SwingOut top to bottom */
-/* Visible control at end of animation */
-#define ANIMA_NOCONTROL_AT_END 0 /* no need surface show/hide at end of animation*/
-#define ANIMA_SHOW_AT_END 1 /* surface show at end of animation */
-#define ANIMA_HIDE_AT_END 2 /* surface hide at end of animation */
-
/* animation data */
struct animation_data {
struct animation_data *next_free; /* free data list */
@@ -184,7 +179,7 @@ ico_window_animation(const int op, void *data)
return ICO_WINDOW_MGR_ANIMATION_RET_ANIMA;
}
- usurf->animation.visible = ANIMA_NOCONTROL_AT_END;
+ usurf->animation.visible = ICO_WINDOW_MGR_ANIMA_NOCONTROL_AT_END;
if (op == ICO_WINDOW_MGR_ANIMATION_OPCANCEL) {
/* cancel animation */
@@ -261,7 +256,7 @@ ico_window_animation(const int op, void *data)
uifw_trace("ico_window_animation: hide(out) %s.%08x anima=%d",
usurf->uclient->appid, usurf->surfaceid, animaid);
ret = ICO_WINDOW_MGR_ANIMATION_RET_ANIMANOCTL;
- usurf->animation.visible = ANIMA_HIDE_AT_END;
+ usurf->animation.visible = ICO_WINDOW_MGR_ANIMA_HIDE_AT_END;
}
else if (op == ICO_WINDOW_MGR_ANIMATION_OPMOVE) {
usurf->animation.state = ICO_WINDOW_MGR_ANIMATION_STATE_MOVE;
@@ -483,10 +478,10 @@ animation_end(struct uifw_win_surface *usurf, const int disp)
}
}
if (disp) {
- usurf->restrain_configure = 0;
uifw_trace("animation_end: %08x vis=%d(%x)",
usurf->surfaceid, usurf->visible, usurf->animation.visible);
- if ((usurf->animation.visible == ANIMA_HIDE_AT_END) &&
+ usurf->internal_propchange |= 0x10;
+ if ((usurf->animation.visible == ICO_WINDOW_MGR_ANIMA_HIDE_AT_END) &&
(usurf->visible != 0)) {
usurf->visible = 0;
ivi_layout_surfaceSetVisibility(usurf->ivisurf, 0);
@@ -496,7 +491,7 @@ animation_end(struct uifw_win_surface *usurf, const int disp)
weston_view_geometry_dirty(ev);
}
}
- if ((usurf->animation.visible == ANIMA_SHOW_AT_END) &&
+ if ((usurf->animation.visible == ICO_WINDOW_MGR_ANIMA_SHOW_AT_END) &&
(usurf->visible == 0)) {
usurf->visible = 1;
ivi_layout_surfaceSetVisibility(usurf->ivisurf, 1);
@@ -506,8 +501,10 @@ animation_end(struct uifw_win_surface *usurf, const int disp)
weston_view_geometry_dirty(ev);
}
}
+ usurf->internal_propchange &= ~0x10;
+ usurf->restrain_configure = 0;
}
- usurf->animation.visible = ANIMA_NOCONTROL_AT_END;
+ usurf->animation.visible = ICO_WINDOW_MGR_ANIMA_NOCONTROL_AT_END;
if (usurf->animation.next_anima != ICO_WINDOW_MGR_ANIMATION_NONE) {
switch(usurf->animation.type) {
case ICO_WINDOW_MGR_ANIMATION_OPHIDE:
@@ -639,16 +636,22 @@ animation_slide(struct weston_animation *animation,
usurf->surfaceid, par, x, y, usurf->x, usurf->y, (int)usurf->ivisurf);
}
if (ivi_layout_getPropertiesOfSurface(usurf->ivisurf, &prop) == 0) {
+ usurf->internal_propchange |= 0x20;
if (ivi_layout_surfaceSetDestinationRectangle(usurf->ivisurf, x, y,
prop.destWidth, prop.destHeight) == 0) {
ivi_layout_commitChanges();
}
+ usurf->internal_propchange &= ~0x20;
}
if (par >= 100) {
/* end of animation */
animation_end(usurf, 1);
uifw_trace("animation_slide: End of animation");
}
+ else {
+ /* continue animation */
+ weston_compositor_schedule_repaint(weston_ec);
+ }
}
/*--------------------------------------------------------------------------*/
@@ -1043,7 +1046,7 @@ animation_fade(struct weston_animation *animation,
}
if (ev->alpha < 0.0f) ev->alpha = 0.0f;
else if (ev->alpha > 1.0f) ev->alpha = 1.0f;
-
+
if ((par < 8) || (par > 92)) {
uifw_debug("animation_fade: %08x count=%d %d%% alpha=%1.2f anima=%d state=%d",
usurf->surfaceid, animation->frame_counter, par,
@@ -1142,7 +1145,7 @@ animation_zoom(struct weston_animation *animation,
if (ev) {
wl_list_insert(&ev->geometry.transformation_list,
&animadata->transform.link);
- }
+ }
}
animadata->end_function = animation_zoom_end;
diff --git a/src/ico_window_mgr.c b/src/ico_window_mgr.c
index 1ee465d..ba42be8 100644
--- a/src/ico_window_mgr.c
+++ b/src/ico_window_mgr.c
@@ -1259,6 +1259,8 @@ ico_ivi_surfacePropertyNotification(struct ivi_layout_surface *ivisurf,
uint32_t id_surface;
int retanima;
uint32_t newmask;
+ int send_event;
+ int send_visible;
struct uifw_win_surface *usurf;
struct weston_view *ev;
@@ -1267,9 +1269,12 @@ ico_ivi_surfacePropertyNotification(struct ivi_layout_surface *ivisurf,
id_surface = ivi_layout_getIdOfSurface(ivisurf);
usurf = ico_window_mgr_get_usurf(id_surface);
- if ((newmask != 0) && (usurf != NULL)) {
+ if ((usurf != NULL) && (newmask != 0) && (usurf->internal_propchange == 0)) {
uifw_trace("ico_ivi_surfacePropertyNotification: Property %x(%08x) usurf=%08x",
id_surface, newmask, (int)usurf);
+
+ send_event = 0;
+ send_visible = usurf->visible;
if (newmask & (IVI_NOTIFICATION_SOURCE_RECT|IVI_NOTIFICATION_DEST_RECT|
IVI_NOTIFICATION_POSITION|IVI_NOTIFICATION_DIMENSION)) {
/* change position or size */
@@ -1285,6 +1290,7 @@ ico_ivi_surfacePropertyNotification(struct ivi_layout_surface *ivisurf,
else {
usurf->client_width = prop->sourceWidth;
usurf->client_height = prop->sourceHeight;
+ send_event ++;
}
if ((usurf->x == prop->destX) && (usurf->y == prop->destY) &&
(usurf->width == prop->destWidth) && (usurf->height == prop->destHeight)) {
@@ -1292,6 +1298,7 @@ ico_ivi_surfacePropertyNotification(struct ivi_layout_surface *ivisurf,
IVI_NOTIFICATION_POSITION|IVI_NOTIFICATION_DIMENSION));
}
else {
+ send_event ++;
usurf->x = prop->destX;
usurf->y = prop->destY;
usurf->width = prop->destWidth;
@@ -1353,9 +1360,16 @@ ico_ivi_surfacePropertyNotification(struct ivi_layout_surface *ivisurf,
usurf->animation.alpha = 1.0;
}
}
- if ((usurf->visible == 0) && (prop->visibility)) {
+ if ((prop->visibility != 0) &&
+ ((usurf->org_animation.saved !=0) ||
+ ((usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_NONE) &&
+ (usurf->visible == 0)) ||
+ ((usurf->animation.state != ICO_WINDOW_MGR_ANIMATION_STATE_NONE) &&
+ (usurf->animation.visible == ICO_WINDOW_MGR_ANIMA_HIDE_AT_END)))) {
uifw_trace("ico_ivi_surfacePropertyNotification: %08x Visible 0=>1",
id_surface);
+ send_event ++;
+ send_visible = 1;
usurf->visible = 1;
if ((usurf->animation.show_anima != ICO_WINDOW_MGR_ANIMATION_NONE) &&
(win_mgr_hook_animation != NULL)) {
@@ -1367,9 +1381,16 @@ ico_ivi_surfacePropertyNotification(struct ivi_layout_surface *ivisurf,
retanima);
}
}
- else if ((usurf->visible != 0) && (! prop->visibility)) {
+ else if ((prop->visibility == 0) &&
+ ((usurf->org_animation.saved !=0) ||
+ ((usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_NONE) &&
+ (usurf->visible != 0)) ||
+ ((usurf->animation.state != ICO_WINDOW_MGR_ANIMATION_STATE_NONE) &&
+ (usurf->animation.visible == ICO_WINDOW_MGR_ANIMA_SHOW_AT_END)))) {
uifw_trace("ico_ivi_surfacePropertyNotification: %08x Visible 1=>0",
id_surface);
+ send_event ++;
+ send_visible = 0;
usurf->visible = 0;
if ((usurf->animation.show_anima != ICO_WINDOW_MGR_ANIMATION_NONE) &&
(win_mgr_hook_animation != NULL)) {
@@ -1388,8 +1409,10 @@ ico_ivi_surfacePropertyNotification(struct ivi_layout_surface *ivisurf,
else {
usurf->visible = 1;
uifw_trace("ico_ivi_surfacePropertyNotification: Change to Visible");
+ usurf->internal_propchange |= 0x01;
ivi_layout_surfaceSetVisibility(ivisurf, 1);
ivi_layout_commitChanges();
+ usurf->internal_propchange &= ~0x01;
}
}
else {
@@ -1398,15 +1421,15 @@ ico_ivi_surfacePropertyNotification(struct ivi_layout_surface *ivisurf,
}
}
- if (newmask) {
+ if (send_event > 0) {
/* 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) mgr=%08x", id_surface,
- usurf->visible, usurf->client_width, usurf->client_height,
+ send_visible, usurf->client_width, usurf->client_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,
+ send_visible, usurf->client_width,
usurf->client_height, usurf->x, usurf->y,
usurf->width, usurf->height);
}
@@ -2324,6 +2347,7 @@ uifw_layout_surface(struct wl_client *client, struct wl_resource *resource,
usurf->surfaceid);
}
}
+ usurf->internal_propchange |= 0x02;
if (visible >= 0) {
if (ivi_layout_surfaceSetVisibility(usurf->ivisurf, visible) != 0) {
uifw_warn("uifw_layout_surface: surface(%08x) can not set visibility",
@@ -2333,6 +2357,7 @@ uifw_layout_surface(struct wl_client *client, struct wl_resource *resource,
if (ivi_layout_commitChanges() != 0) {
uifw_warn("uifw_layout_surface: surface(%08x) commit Error", usurf->surfaceid);
}
+ usurf->internal_propchange &= ~0x02;
uifw_trace("uifw_layout_surface: Leave");
}
diff --git a/src/ico_window_mgr_private.h b/src/ico_window_mgr_private.h
index d4279ee..f21187d 100644
--- a/src/ico_window_mgr_private.h
+++ b/src/ico_window_mgr_private.h
@@ -154,11 +154,11 @@ struct uifw_win_surface {
uint16_t configure_height; /* Height that a client(App) configured */
char winname[ICO_IVI_WINNAME_LENGTH];/* Window name */
char visible; /* visibility */
+ char internal_propchange; /* internal surface property change */
char restrain_configure; /* restrant configure event */
- char res[1]; /* (unused) */
struct uifw_win_surface_animation
animation; /* window animation information */
- struct uifw_win_surface_anima_save
+ struct uifw_win_surface_anima_save
org_animation; /* save original wndow animation */
struct wl_list client_link; /* surface list of same client */
struct wl_list surf_map; /* surface map list */
@@ -195,6 +195,11 @@ struct uifw_win_surface {
#define ICO_WINDOW_MGR_ANIMATION_OPHIDEPOS 11 /* change to hide with position */
#define ICO_WINDOW_MGR_ANIMATION_OPSHOWPOS 12 /* change to show with position */
+/* Visible control at end of animation */
+#define ICO_WINDOW_MGR_ANIMA_NOCONTROL_AT_END 0 /* no need show/hide at end of anima*/
+#define ICO_WINDOW_MGR_ANIMA_SHOW_AT_END 1 /* surface show at end of animation*/
+#define ICO_WINDOW_MGR_ANIMA_HIDE_AT_END 2 /* surface hide at end of animation*/
+
/* Prototype for function */
/* find uifw_client table */
struct uifw_client *ico_window_mgr_find_uclient(struct wl_client *client);