ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.29k stars 62 forks source link

[Bug] Keyboard navigation in panel has strange behavior #302

Closed pwnfooj716 closed 1 year ago

pwnfooj716 commented 1 year ago

Currently, using the arrow keys to go up and down in the panel causes the selected item to skip by two on each key press. Alt+arrow keys produces the expected behavior of skipping by one on each key press which is super unintuitive. If anything, the behavior should be flipped. In addition, Page Up/Down also seems to skip by one on each key press instead of skipping by one screen-full (not sure if that's the intended behavior because it is not documented anywhere). Further, Page Up seems to have a bug where a notification is skipped past if it does not have an icon associated with it***. It's also worth nothing that it is not documented anywhere that Alt+arrow keys and Page Up/Down do anything.

On another note, using the keyboard to navigate the panel does not scroll to keep the selection on screen. If you arrow down until the selected item is off screen, it should automatically scroll so that the item is on screen.

*Steps to reproduce bug with Page Up key: 1) Trigger a notification with an icon (e.g. notify-send --icon=dialog-warning Warning "This is a warning") 2) Trigger a notification without** an icon (e.g. notify-send "Text Alert" "This notification contains only text") 3) Trigger another notification with an icon (e.g. notify-send --icon=dialog-information Info "This is some important information") 4) Open swaync panel and arrow down to select least recent notification 5) Press PageUp key

Expected behavior: 2nd notification is selected Actual behavior: Most recent notification is selected

Swaync may not be a keyboard-centric notification daemon like dunst, mako, etc., but what made this project stand out to me versus those others is the fact that it can be controlled both with mouse and keyboard quite nicely and look good while doing so. If these quirks can be ironed out, swaync would definitely be one of he best wayland notification daemon out there.

ErikReider commented 1 year ago

Very strange, I'm also experiencing this... I'll look into it when I have time. Knowing which commit messed it up would speed it up on my end so I'd appreciate it if you're willing to help :)

pwnfooj716 commented 1 year ago

Found it! The culprit is commit ba4a2665fa31c71e1e7be3eef5cbd323a3426d7c. I'll see if I can do some further digging, but that should help immensely.

pwnfooj716 commented 1 year ago

Wow, thanks so much for the speedy fix! Just tested it and it works. However, the issue for scrolling the panel when the selected notification goes off screen still remains. Should I open up a new issue for this specifically?

Also, I realize that part is probably more of a feature request than a bug and will probably require more effort to implement which is totally understandable.