summaryrefslogtreecommitdiff
path: root/src/pa-sink-ctl.c
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-10-21 23:07:34 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-10-21 23:16:24 +0200
commit7f3831b86ab19512fab51a4c7ca5bcffdde7ce03 (patch)
tree581ab3ed916bb043b063222fa87d9553a6da76d1 /src/pa-sink-ctl.c
parent0fbe244eba08f748645233fef6f6556fb3d70e5e (diff)
downloadpa-sink-ctl-7f3831b86ab19512fab51a4c7ca5bcffdde7ce03.tar.gz
pa-sink-ctl-7f3831b86ab19512fab51a4c7ca5bcffdde7ce03.tar.bz2
pa-sink-ctl-7f3831b86ab19512fab51a4c7ca5bcffdde7ce03.zip
Fix selection when moving an input around
We may not get the update for the moved index immediately, but we calculate the new position for the selection on redraw. So schedule redraw until we get the update, when we move around.
Diffstat (limited to 'src/pa-sink-ctl.c')
-rw-r--r--src/pa-sink-ctl.c9
1 files changed, 7 insertions, 2 deletions
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;
}