After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754096 - space doesn't always toggle pause/play
space doesn't always toggle pause/play
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
unspecified
Other Linux
: High normal
: ---
Assigned To: gnome-music-maint
gnome-music-maint
Depends on:
Blocks: 758637
 
 
Reported: 2015-08-25 20:54 UTC by Bastian Ilsø
Modified: 2016-10-10 10:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use Ctrl+P instead of space as a play shortcut. (2.41 KB, patch)
2016-03-17 22:05 UTC, Evandro Giovanini
none Details | Review
Use Ctrl+P and Ctrl+Space as play/pause shortcut. (2.44 KB, patch)
2016-03-22 18:15 UTC, Evandro Giovanini
committed Details | Review
Unbind Ctrl+space and Ctrl+P (1.88 KB, patch)
2016-03-23 10:56 UTC, Gaurav Narula
reviewed Details | Review
shortcuts: remove Ctrl+P for Play/Pause (1.84 KB, patch)
2016-09-12 14:07 UTC, Yash
committed Details | Review

Description Bastian Ilsø 2015-08-25 20:54:18 UTC
If next_button or prev_button is focused, pressing space will activate these buttons rather than pausing/playing music. Space bar is a shortcut for playing or pausing music in media players and pressing it should (IMO) consistently pause or play the music regardless of without activating what widget might be in focus.

Steps to reproduce:
 * Play a song from an album
 * press Next
 * Press space
Comment 1 Bastian Ilsø 2015-08-25 20:59:00 UTC
(note that I am not particular well knowledged on how accessibility and space bar works together).
Comment 2 Felipe Borges 2015-11-29 18:00:26 UTC
Totem uses Ctrol + Space or P.

The space bar is important for accessibility. See also: https://bugzilla.gnome.org/show_bug.cgi?id=758637
Comment 3 Bastien Nocera 2015-12-16 13:01:33 UTC
You really shouldn't be using unmodified shortcuts in a UI full of widgets. Totem gets away with it because that shortcut only works when the video view is visible.

Eating Space unmodified will either not work properly, or break keyboard navigation (it's used to activate buttons, menus, etc.).

Ctrl+Space (as rhythmbox does) or Ctrl+Return are fine alternatives. Also make sure that the "Play" keyboard key works.
Comment 4 Evandro Giovanini 2016-03-17 22:05:04 UTC
Created attachment 324218 [details] [review]
Use Ctrl+P instead of space as a play shortcut.

From Bastien Nocera on Bugzilla:
"You really shouldn't be using unmodified shortcuts in a UI full of
widgets. Totem gets away with it because that shortcut only works when
the video view is visible.

Eating Space unmodified will either not work properly, or break
keyboard navigation (it's used to activate buttons, menus, etc.)."

Instead of space we're using the Ctrl+P combination.
Comment 5 Bastien Nocera 2016-03-18 10:38:15 UTC
Ctrl+Space is also a good shortcut.
Comment 6 Evandro Giovanini 2016-03-21 17:40:32 UTC
Huh. I changed the patch to accept Ctrl+Space (as well as Ctrl+P) and it seems that both Ctrl+Space and Ctrl+Return are used to enter selection mode, depending on the active widget. I'm not really sure where that behavior is coming from though, any ideas?
Comment 7 Evandro Giovanini 2016-03-22 18:15:49 UTC
Created attachment 324552 [details] [review]
Use Ctrl+P and Ctrl+Space as play/pause shortcut.

Use them instead of space. From Bastien Nocera on Bugzilla:
"You really shouldn't be using unmodified shortcuts in a UI full of
widgets. Totem gets away with it because that shortcut only works when
the video view is visible.

Eating Space unmodified will either not work properly, or break
keyboard navigation (it's used to activate buttons, menus, etc.)."
Comment 8 Felipe Borges 2016-03-22 18:42:58 UTC
Review of attachment 324552 [details] [review]:

Sure.
Comment 9 Felipe Borges 2016-03-22 18:44:52 UTC
Thanks for your patch.

Attachment 324552 [details] pushed as 59d029d - Use Ctrl+P and Ctrl+Space as play/pause shortcut.
Comment 10 Felipe Borges 2016-03-23 10:23:41 UTC
I missed the conflicts with selection-mode and the move-cursor signal for treeview, as pointed out to me by Gaurav Narula on IRC. So we should handle/discuss that before.

I reverted the commit for now. b717c27
Comment 11 Gaurav Narula 2016-03-23 10:56:26 UTC
Created attachment 324582 [details] [review]
Unbind Ctrl+space and Ctrl+P

Builds on the patch by Evandro Giovanini. Unbinded Ctrl+Space and Ctrl+P on treeview and iconview. Also added a check to ensure currentTrack is not None before trying to toggle pause.
Comment 12 Felipe Borges 2016-04-04 08:25:31 UTC
Review of attachment 324582 [details] [review]:

Thanks for your patch, but I'm afraid we need to discuss this more further. Break the shortcut compatibility with other applications that have selection-mode is not desirable.
Comment 13 Marinus Schraal 2016-08-16 13:29:44 UTC
Would like to get this resolved before 3.22 .
Comment 14 Yash 2016-08-19 18:38:56 UTC
@Gaurav Narula: Hi Gaurav. I would like to work on this bug.
Comment 15 Gaurav Narula 2016-08-26 04:58:34 UTC
@Yash: sure, feel free to work on this

@Marinus, @Felipe: I'm helping Yash get started and thought this might be a good first bug. Could you guys suggest an approach that doesn't break compatibility with selection-mode?
Comment 16 Jeremy Bicha 2016-09-09 16:22:26 UTC
The keyboard shortcuts popup window says Ctrl + Space (or ctrl + p) toggles play/pause, but currently, it's just Space (and ctrl + p) and Ctrl + Space does nothing related to play/pause.
Comment 17 Marinus Schraal 2016-09-12 00:02:25 UTC
The problem is we use some widgets that override space/ctrl+space and mess with our keybinds. It does work whenever you are not focused on any of these.

Since ctrl+p is working as intended, maybe we should only advertise that for now. Until we solve the issues with ctrl+space.
Comment 18 Jeremy Bicha 2016-09-12 00:13:27 UTC
(In reply to Marinus Schraal from comment #17)
> Since ctrl+p is working as intended, maybe we should only advertise that for
> now. Until we solve the issues with ctrl+space.

I like that idea. In fact, that's what I did in the Ubuntu 16.10 Beta packaging.
Comment 19 Marinus Schraal 2016-09-12 10:05:54 UTC
(In reply to Jeremy Bicha from comment #18)
> (In reply to Marinus Schraal from comment #17)
> > Since ctrl+p is working as intended, maybe we should only advertise that for
> > now. Until we solve the issues with ctrl+space.
> 
> I like that idea. In fact, that's what I did in the Ubuntu 16.10 Beta
> packaging.

I removed the accelerator for now from the UI file, to avoid confusion.

I would still like to have this tackled so we can bring it back.
Comment 20 Marinus Schraal 2016-09-12 13:00:54 UTC
It turns out we had some oldstyle css to unbind keys, fixing this resolved all issues afaics. So, I brought back the ctrl+space in the shortcuts window.

Please test.
Comment 21 Bastian Ilsø 2016-09-12 13:45:37 UTC
(In reply to Marinus Schraal from comment #20)
> It turns out we had some oldstyle css to unbind keys, fixing this resolved
> all issues afaics. So, I brought back the ctrl+space in the shortcuts window.
> 
> Please test.

Ctrl+space toggles play/pause now, but it also toggles selection mode for me at the same time
Comment 22 Yash 2016-09-12 14:07:55 UTC
Created attachment 335366 [details] [review]
shortcuts: remove Ctrl+P for Play/Pause
Comment 23 Marinus Schraal 2016-09-12 16:10:31 UTC
Review of attachment 335366 [details] [review]:

lgtm
Comment 24 Marinus Schraal 2016-09-12 20:15:41 UTC
Comment on attachment 335366 [details] [review]
shortcuts: remove Ctrl+P for Play/Pause

After some discussion on irc decided to drop ctrl+p, as it was just a workaround for the difficulties with ctrl+space.

Thanks for the quick patch.
Comment 25 Bastian Ilsø 2016-09-14 12:20:08 UTC
(In reply to Bastian Ilsø from comment #21)
> (In reply to Marinus Schraal from comment #20)
> > It turns out we had some oldstyle css to unbind keys, fixing this resolved
> > all issues afaics. So, I brought back the ctrl+space in the shortcuts window.
> > 
> > Please test.
> 
> Ctrl+space toggles play/pause now, but it also toggles selection mode for me
> at the same time

turns out i needed to force rebuild gnome-music, everything works as expected now. thanks!
Comment 26 Marinus Schraal 2016-10-10 10:09:42 UTC
Closing, available in 3.22.