summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/interface.c1
-rw-r--r--src/pa-sink-ctl.c9
-rw-r--r--src/pa-sink-ctl.h1
3 files changed, 9 insertions, 2 deletions
diff --git a/src/interface.c b/src/interface.c
index 8c1f0b9..f48363b 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -332,6 +332,7 @@ interface_get_input(GIOChannel *source, GIOCondition condition, gpointer data)
sink = g_list_nth_data(ctx->sink_list, ctx->chooser_sink);
/* ctx->chooser_input needs to be derived from $ctx->selected_index */
ctx->chooser_input = SELECTED_UNKNOWN;
+ ctx->block_for_selected_index = TRUE;
pa_operation_unref(pa_context_move_sink_input_by_index(ctx->context, ctx->selected_index,
sink->index,
change_callback, NULL));
diff --git a/src/pa-sink-ctl.c b/src/pa-sink-ctl.c
index e0f91c7..8e0be30 100644
--- a/src/pa-sink-ctl.c
+++ b/src/pa-sink-ctl.c
@@ -55,12 +55,16 @@ get_sink_input_info_callback(pa_context *c, const pa_sink_input_info *i, gint is
}
if (is_last) {
- print_sink_list(ctx);
+ if (!ctx->block_for_selected_index)
+ print_sink_list(ctx);
return;
}
if (!(i->client != PA_INVALID_INDEX)) return;
+ if (ctx->block_for_selected_index && i->index == ctx->selected_index)
+ ctx->block_for_selected_index = FALSE;
+
sink_input_info sink_input = {
.index = i->index,
.sink = i->sink,
@@ -95,7 +99,8 @@ get_sink_info_callback(pa_context *c, const pa_sink_info *i, gint is_last, gpoin
}
if (is_last) {
- print_sink_list(ctx);
+ if (!ctx->block_for_selected_index)
+ print_sink_list(ctx);
return;
}
diff --git a/src/pa-sink-ctl.h b/src/pa-sink-ctl.h
index 699c21e..82ee1f6 100644
--- a/src/pa-sink-ctl.h
+++ b/src/pa-sink-ctl.h
@@ -31,6 +31,7 @@ struct context {
GList *input_list;
gchar *status;
+ gboolean block_for_selected_index;
};
void