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

Elementary OS: menu items misplaced after refresh/change #55

Closed megatux closed 5 years ago

megatux commented 7 years ago

captura realizada el 2017-06-15 09 24 19

megatux commented 7 years ago

Also, if I click "Refresh" all inputs & outputs move to the bottom, too.

yktoo commented 7 years ago

Was already reported as #44 but no further info provided.

It looks like GTK+ bug and I wasn't able to reproduce it. What's your OS version?

Can you insert

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

before self.menu.insert(new_item, i) in indicator-sound-switcher and attach the output when it's run with the -vv command line switch, both before and after the refresh?

megatux commented 7 years ago

Elementary OS Loki with GTK+ 3.18.9. I did a refresh first, then a plug/unplug of headset. Attached imgs & debug output:

s1

s2 debug.txt

Let me know if you need something else. Thx!

yktoo commented 7 years ago

This is apparently Elementary (read Pantheon) specific as it's never been reported with Ubuntu. Will look at it as soon as I have time.

davidmaxwaterman commented 6 years ago

I think I see this on ubuntu 17:10 too:

screenshot from 2018-02-23 17-28-21

It looks fine when I start the app, but when I click refresh, all the outputs are moved under the inputs. (version 2.1.1)

davidmaxwaterman commented 6 years ago

Any thoughts on this? It's still broken many months later, and I'm not sure if it is a proven problem or not.

yktoo commented 6 years ago

It must be a bug in Gtk. If I look at the item order in memory, it's perfectly correct:

######### menu_insert_ordered_item(Outputs, ,     High Definition Audio Controller ‣ HDMI / DisplayPort, False)
#########+++ idx_from=3, idx_to=3
---------------- Item [2]/'Outputs'
---------------- Item [3]/''
------------ Added item 3/'    High Definition Audio Controller ‣ HDMI / DisplayPort'
######### menu_insert_ordered_item(Outputs, ,     High Definition Audio Controller ‣ HDMI / DisplayPort 2, False)
#########+++ idx_from=3, idx_to=4
---------------- Item [2]/'Outputs'
---------------- Item [3]/'    High Definition Audio Controller ‣ HDMI / DisplayPort'
---------------- Item [4]/''
------------ Added item 4/'    High Definition Audio Controller ‣ HDMI / DisplayPort 2'

Yet, the Outputs item is rendered below the corresponding output item: screenshot from 2018-04-11 15-54-42

yktoo commented 6 years ago

A possible (lame) workaround might be to completely reload the entire menu. Does this issue also occur when you plug/unplug devices?

yktoo commented 5 years ago

Resolved in 2.2.0.