GNOME Bugzilla – Bug 683107
keynav for alarm stop and snooze
Last modified: 2020-11-24 13:29:18 UTC
Proposal: - pressing any key -> stop - pressing esc -> snooze
Problem facing: I've basically stopping or snoozing alarm from ringing_panel but I'm not able to close or press any button from notification window so suppose user presses esc then alarm gets set on snooze mode from ringing_panel but after that if user presses stop from notification window then alarm gets set to stop mode. This problem is a kind of bug too as normally we press stop or snooze from ringing_panel but ultimately the state of alarm depends on which button is pressed from notification window. Need hint: 1 > Can I press stop or snooze button from notification window or can I activate related actions manually ? or Can I destroy notification window manually when user presses any key ?
I guess we want that if user presses stop or snooze button from ringing_panel then notification dialogue box should get destroyed.
Created attachment 267164 [details] [review] This allows to stop/snooze alarm using keynav. Escape -> Snooze alarm. Any other key -> Stop alarm. "Clocks" should be focused while pressing key. In other words key events should be identified to "Clocks".
ping
Review of attachment 267164 [details] [review]: sorry for the very long delay. I do not think this is the right approach, we should not handle the keypress event manually. We should instead add appropriate GActions and then bind keyboard shortcuts to such actions
@Paolo: I could come up with a GAction version for snoozing, but how do I add a GAction with "Any other key than Escape"? Is it even possible, or for that, we should still handle the keypress?
Review of attachment 267164 [details] [review]: Mmmm... you are right, I missed the "any-key" part. I withdraw my previous review, however some comments about the implementation follow ::: src/alarm.vala @@ -159,3 +159,3 @@ public virtual signal void ring () { var app = GLib.Application.get_default (); - app.send_notification (null, notification); + app.send_notification ("notify", notification); I'd call this "alarm-notification" or even simply "alarm", so that we can distinguish it from the timer one if needed @@ -656,1 +656,5 @@ public bool escape_pressed () { + if (visible_child == ringing_panel) { + ringing_panel.alarm.snooze (); + var app = GLib.Application.get_default (); + app.withdraw_notification ("notify"); here we should return true, since if we are in the ringing panel we do not need to cancel the selection mode ::: src/clock.vala @@ -47,1 +47,5 @@ + public virtual bool other_key_pressed () { + return false; + } + However I do not like much the other_key_pressed virtual method, the escape_pressed thing was already a hack just to cancel the selection mode and if possible I would prefer to not go down this slippery slope. Does simply connecting to the key_press_event in the ringing panel work? Maybe making sure that when ringing the focus is placed correctly
In the current design, a ringing alarm has two buttons on screen, Stop and Snooze. Tab can be used to go through the available options. That’s usable enough.