yktoo / indicator-sound-switcher

Sound input/output selector indicator for Linux
https://yktoo.com/en/software/sound-switcher-indicator/
GNU General Public License v3.0
367 stars 29 forks source link

Error displaying the device list / Ошибка отображения списка устройств #44

Closed mobdiz closed 7 years ago

mobdiz commented 7 years ago

Confused place inputs and outputs after clicking on "Update". Elementary OS (Ubuntu 16.04). What information is still needed from me?

Путаются места входов и выходов после нажатия на "Обновить". Elementary OS (Ubuntu 16.04). Какие данные еще нужны от меня?

yktoo commented 7 years ago

Не могли бы вы прикрепить скриншот, а также вывод программы в консоли, если её запустить с ключом: indicator-sound-switcher -vv ?

mobdiz commented 7 years ago

Лог: http://pastebin.com/cMhnnVmS Скриншоты: До нажатия на "Обновить", После нажатия на "Обновить"

yktoo commented 7 years ago

«До» и «после» — одна и та же картинка :)

mobdiz commented 7 years ago

Поправил ссылку

yktoo commented 7 years ago

Хм, весьма забавный баг. Какая версия системы и Python у вас? Выполните, пожалуйста:

env python3 --version
lsb_release -a
uname -a
mobdiz commented 7 years ago

Python 3.5.2

No LSB modules are available. Distributor ID: elementary Description: elementary OS 0.4 Loki Release: 0.4 Codename: loki

Linux user-A17W8 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

yktoo commented 7 years ago

Я думаю, проблема в реализации Gtk API в Elementary. Воспроизводится ли данная ошибка до сих пор?

mobdiz commented 7 years ago

Да. Все ещё воспроизводится

yktoo commented 7 years ago

Я не могу представить себе условий, при которых может случиться такая ситуация, за исключением бага в menu.insert(). Код не оставляет никакого простора для толкований:

        # Find out item indexes
        items = self.menu.get_children()
        idx_from = 0 if after_item is None else items.index(after_item) + 1
        idx_to   = items.index(before_item)

        # If there's at least one item, get the group from it
        group = [] if idx_to == idx_from else items[idx_from].get_group()

        # Create and setup a new radio item
        new_item = Gtk.RadioMenuItem.new_with_mnemonic(group, label)
        if show:
            new_item.show()

        # Find an appropriate position for the item so that they are in alphabetical order
        i = idx_from
        while (i < idx_to) and (label >= items[i].get_label()):
            i += 1

        # Insert the item
        self.menu.insert(new_item, i)

Вы можете вставить строку

print('Label: "%s"; index: "%d"' % (label, i))

перед self.menu.insert(new_item, i) и прислать вывод (при запуске с -vv), до и после обновления?

yktoo commented 7 years ago

Closing for now, pls reopen if the requested info is provided.