Revert "link: add WP_LINK_FEATURE_ESTABLISHED to track when a link is PAUSED/ACTIVE"
This reverts commit9def3f96d2
. This was never a good idea, as it turns out. It was not used in practice because it was breaking other things (see370b692933
) and now it appears to be causing more problems in Lua object managers that don't install because they are waiting for inactive links to become active. Fixes: #518
This commit is contained in:
@@ -100,17 +100,6 @@ wp_link_get_property (GObject * object, guint property_id,
|
||||
}
|
||||
}
|
||||
|
||||
static WpObjectFeatures
|
||||
wp_link_get_supported_features (WpObject * object)
|
||||
{
|
||||
return wp_pw_object_mixin_get_supported_features (object)
|
||||
| WP_LINK_FEATURE_ESTABLISHED;
|
||||
}
|
||||
|
||||
enum {
|
||||
STEP_WAIT_ESTABLISHED = WP_PW_OBJECT_MIXIN_STEP_CUSTOM_START,
|
||||
};
|
||||
|
||||
static void
|
||||
wp_link_activate_execute_step (WpObject * object,
|
||||
WpFeatureActivationTransition * transition, guint step,
|
||||
@@ -126,9 +115,6 @@ wp_link_activate_execute_step (WpObject * object,
|
||||
case WP_PW_OBJECT_MIXIN_STEP_WAIT_INFO:
|
||||
/* just wait, info will be emitted anyway after binding */
|
||||
break;
|
||||
case STEP_WAIT_ESTABLISHED:
|
||||
/* just wait again, the state will be changed automatically */
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
@@ -150,7 +136,6 @@ static void
|
||||
wp_link_pw_proxy_destroyed (WpProxy * proxy)
|
||||
{
|
||||
wp_pw_object_mixin_handle_pw_proxy_destroyed (proxy);
|
||||
wp_object_update_features (WP_OBJECT (proxy), 0, WP_LINK_FEATURE_ESTABLISHED);
|
||||
|
||||
WP_PROXY_CLASS (wp_link_parent_class)->pw_proxy_destroyed (proxy);
|
||||
}
|
||||
@@ -164,7 +149,8 @@ wp_link_class_init (WpLinkClass * klass)
|
||||
|
||||
object_class->get_property = wp_link_get_property;
|
||||
|
||||
wpobject_class->get_supported_features = wp_link_get_supported_features;
|
||||
wpobject_class->get_supported_features =
|
||||
wp_pw_object_mixin_get_supported_features;
|
||||
wpobject_class->activate_get_next_step =
|
||||
wp_pw_object_mixin_activate_get_next_step;
|
||||
wpobject_class->activate_execute_step = wp_link_activate_execute_step;
|
||||
@@ -190,20 +176,13 @@ wp_link_class_init (WpLinkClass * klass)
|
||||
static void
|
||||
wp_link_process_info (gpointer instance, gpointer old_info, gpointer i)
|
||||
{
|
||||
WpObject *object = instance;
|
||||
const struct pw_link_info *info = i;
|
||||
|
||||
if (info->change_mask & PW_LINK_CHANGE_MASK_STATE) {
|
||||
enum pw_link_state old_state = old_info ?
|
||||
((struct pw_link_info *) old_info)->state : PW_LINK_STATE_INIT;
|
||||
|
||||
g_signal_emit (instance, signals[SIGNAL_STATE_CHANGED], 0,
|
||||
old_state, info->state);
|
||||
|
||||
if (info->state >= PW_LINK_STATE_PAUSED && old_state < PW_LINK_STATE_PAUSED)
|
||||
wp_object_update_features (object, WP_LINK_FEATURE_ESTABLISHED, 0);
|
||||
else if (info->state < PW_LINK_STATE_PAUSED && old_state >= PW_LINK_STATE_PAUSED)
|
||||
wp_object_update_features (object, 0, WP_LINK_FEATURE_ESTABLISHED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -29,17 +29,6 @@ typedef enum {
|
||||
WP_LINK_STATE_ACTIVE = 4, /*!< the link is active */
|
||||
} WpLinkState;
|
||||
|
||||
/*!
|
||||
* \brief An extension of WpProxyFeatures
|
||||
* \ingroup wplink
|
||||
*
|
||||
* \since 0.4.11
|
||||
*/
|
||||
typedef enum { /*< flags >*/
|
||||
/*! waits until the state of the link is >= PAUSED */
|
||||
WP_LINK_FEATURE_ESTABLISHED = (WP_PROXY_FEATURE_CUSTOM_START << 0),
|
||||
} WpLinkFeatures;
|
||||
|
||||
/*!
|
||||
* \brief The WpLink GType
|
||||
* \ingroup wplink
|
||||
|
@@ -369,7 +369,7 @@ create_links (WpSiStandardLink * self, WpTransition * transition,
|
||||
|
||||
/* activate to ensure it is created without errors */
|
||||
wp_object_activate_closure (WP_OBJECT (link),
|
||||
WP_OBJECT_FEATURES_ALL & ~WP_LINK_FEATURE_ESTABLISHED, NULL,
|
||||
WP_OBJECT_FEATURES_ALL, NULL,
|
||||
g_cclosure_new_object (
|
||||
(GCallback) on_link_activated, G_OBJECT (transition)));
|
||||
|
||||
|
Reference in New Issue
Block a user