return NULL;
}
-static void
-_e_tzsh_indicator_srv_property_change_send(E_Client *ec)
+EINTERN void
+e_tzsh_indicator_srv_property_change_send(E_Client *ec, int angle)
{
- int angle;
int opacity;
if (!ec) return;
return;
}
- angle = ec->e.state.rot.ang.curr;
opacity = ec->indicator.opacity_mode;
ELOGF("TZ_IND", "SEND indicator info. angle:%d, opacity:%d", ec->pixmap, ec, angle, opacity);
ec_ind_owner = e_mod_indicator_owner_get();
if (ec != ec_ind_owner) return;
- _e_tzsh_indicator_srv_property_change_send(ec);
+ if (ec->e.state.rot.ang.next != -1)
+ e_tzsh_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.next);
+ else
+ e_tzsh_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.curr);
}
EINTERN void
e_mod_indicator_owner_set(ec);
if (ec && !ec->e.state.rot.pending_show)
- e_tzsh_indicator_srv_property_update(ec);
+ {
+ ELOGF("TZ_IND", "Property Update. name:%s curr:%d, next:%d", NULL, NULL, ec->icccm.name?:"NULL",
+ ec->e.state.rot.ang.curr, ec->e.state.rot.ang.next);
+ e_tzsh_indicator_srv_property_update(ec);
+ }
}
}
if (ec->indicator.opacity_mode == op_mode) return;
ec->indicator.opacity_mode = op_mode;
- if (ec == e_mod_indicator_owner_get())
- _e_tzsh_indicator_srv_property_change_send(ec);
+ e_tzsh_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.curr);
e_policy_event_simple(ec, E_EVENT_POLICY_INDICATOR_OPACITY_MODE_CHANGE);
}
/* event handler */
static Eina_List *_ind_handlers = NULL;
static Eina_List *_ind_hooks = NULL;
+static int _ind_angle = -1;
+
+static Eina_Bool
+_indicator_cb_rot_begin(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
+{
+ E_Client *ec = NULL;
+ E_Event_Client_Rotation_Change_Begin *ev = NULL;
+
+ ev = event;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON);
+
+ ec = ev->ec;
+ if (ec == _ind_owner)
+ {
+ if (ec->e.state.rot.ang.next != -1)
+ {
+ ELOGF("TZ_IND", "Rotation begins.(ec:%s) Set indicator's angle to next angle:%d", ec->pixmap, ec, ec->icccm.name?:"NULL", ec->e.state.rot.ang.next);
+ _ind_angle = ec->e.state.rot.ang.next;
+ e_tzsh_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.next);
+ }
+ }
+
+ return ECORE_CALLBACK_PASS_ON;
+}
static Eina_Bool
_indicator_cb_rot_done(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
ec = ev->ec;
if (ec == _ind_owner)
{
- e_tzsh_indicator_srv_property_update(ec);
+ if (_ind_angle != ec->e.state.rot.ang.curr)
+ {
+ ELOGF("TZ_IND", "Rotation is done.(ec:%s) Set indicator's angle to curr angle:%d", ec->pixmap, ec, ec->icccm.name?:"NULL", ec->e.state.rot.ang.curr);
+ _ind_angle = ec->e.state.rot.ang.curr;
+ e_tzsh_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.curr);
+ }
}
return ECORE_CALLBACK_PASS_ON;
e_client_window_role_set(ec, "indicator");
+ E_LIST_HANDLER_APPEND(_ind_handlers, E_EVENT_CLIENT_ROTATION_CHANGE_BEGIN, _indicator_cb_rot_begin, NULL);
+ E_LIST_HANDLER_APPEND(_ind_handlers, E_EVENT_CLIENT_ROTATION_CHANGE_CANCEL, _indicator_cb_rot_done, NULL);
E_LIST_HANDLER_APPEND(_ind_handlers, E_EVENT_CLIENT_ROTATION_CHANGE_END, _indicator_cb_rot_done, NULL);
E_LIST_HOOK_APPEND(_ind_hooks, E_CLIENT_HOOK_DEL, _indicator_cb_client_del, NULL);