timothycrosley / streamdeck-ui

A Linux compatible UI for the Elgato Stream Deck.
https://timothycrosley.github.io/streamdeck-ui/
MIT License
1.13k stars 241 forks source link

Switch page key shows up on the deck and the UI as 'pressed' after pressing #238

Closed godlike64 closed 2 years ago

godlike64 commented 2 years ago

Describe the bug I was toying with my deck by starting to set up multiple pages and the first thing I did was to set some SVG icons (from the Breeze icon set) as forward/backward arrows. I then set the forward arrow key to move to page 2, left backward arrow key blank, then on page 2, on the same 2 keys, I set forward arrow to page 3 and backward arrow to page 1.

As I was trying this out, I noticed that after doing it once, on page 1, the 'forward arrow' ('switch to page 2') key was a bit bold, both on the streamdeck-ui as well as on the streamdeck itself. I closed streamdeck-ui, opened it back up and it was back to normal, but the issue reoccurred after switching to page 2 and back to page 1.

Upon examining it closer, I noticed that whenever I press the keys, the icon changes a bit: it gets 'bolder' or 'brighter' if I press the key all the way in, and goes back to normal when depressed. This was most evident on the 'backward arrow' on page 1, which has no action tied to it. This led me to believe that what is going on is that the 'forward arrow' key on page 1, which switches to page 2, stays in a 'pressed' state, and never gets depressed (or at least, both streamdeck-ui and streamdeck think so).

Also, there seems to be a race condition involved, as if I switch back and forth very quickly, sometimes the key in question will not be stuck in a 'bold/bright' state.

Do note that this is a cosmetic issue: no other abnormal behaviour was noticed. This also seems to happen with a PNG icon. I have only been able to reproduce this with the bottom-right key to switch to page 2. The key to the left of it that goes back to page 1 does not seem to be affected by this issue.

To Reproduce Steps to reproduce the behavior:

  1. Configure 2 keys on page 1 and 2, preferably with an icon that is just black background with white lines, so as to make the issue more evident.
  2. Set 'key 1' to move to page 2.
  3. Configure the same icons on the same keys on page 2 (haven't tried setting them on other keys). Set 'key 2' to move back to page 1.
  4. Use the keys to switch to page 2 and then back to page 1.
  5. The 'key 1' on page 1 should show up bolder/brighter, as if it was pressed.

Expected behavior Key icon should not be left in a 'bold/bright' state

Screenshots This is my streamdeck, just opened, page 1, with the 'go to page 2' key selected:

Screenshot_20220618_122926

My current 'page 2', with the key to go back to page 1 selected: Screenshot_20220618_123002

After triggering the issue, note that the 'forward arrow' key which is configured to go to page 2 is bolder/brighter on the UI. It is also bolder/brighter on the deck itself:

Screenshot_20220618_123136

Operating system (please complete the following information)

Stream Deck Version

godlike64 commented 2 years ago

Commenting the keypress lines in display/display_grid.py seem to workaround this issue:

69     def replace(self, page: int, button: int, filters: List[Filter]):     
70         with self.lock:                                                   
71             pipeline = Pipeline()                                         
72             pipeline.add(DisplayGrid._empty_filter)                       
73             for filter in filters:                                        
74                 filter.initialize(self.size)                              
75                 pipeline.add(filter)                                      
76             #keypress = KeypressFilter()                                  
77             #keypress.initialize(self.size)                               
78             #pipeline.add(keypress)                                       
79             self.pages[page][button] = pipeline                           

I still have no idea why this behaviour is being triggered. My limited knowledge of streamdeck-ui can only go so far :)

dodgyrabbit commented 2 years ago

Can you please update to version 2.0.4. This was fixed in 2.0.4 and I want to confirm it's working for you before closing.

https://github.com/timothycrosley/streamdeck-ui/blob/master/CHANGELOG.md

godlike64 commented 2 years ago

My bad, should have checked for new version before opening this. Yes, 2.0.4 indeed fixes this issue. I'll close this then. Thanks!