Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Losing focus so space does not work #1002

Closed
spamatica opened this issue May 19, 2021 · 14 comments
Closed

Losing focus so space does not work #1002

spamatica opened this issue May 19, 2021 · 14 comments
Labels

Comments

@spamatica
Copy link
Member

I think this has been fixed before, possibly it is due to different versions of Qt?

If you are inside an editors (at least the pianoroll) and use ESC to get back to the arranger, space no longer functions to stop playback until you click on the canvas.

Not the same issue but space has also stopped working when you open the mixer as the volume field in the selected channel strip will take the focus. I'm pretty sure I fixed this before but it reappeared..

Using AppImage for 4.0

@kybos
Copy link
Contributor

kybos commented May 20, 2021

The first problem is not reproducible here. Space always keeps working in the arranger for me, no matter if I opened the pianoroll in tab or as a separate window (Qt 5.9.5).

The second one yes, the focus is in the volume text field. I remember you and Tim had a discussion some time ago about how the focus should behave in the mixer, both of you made some changes to it. But I may be mistaken.

@spamatica
Copy link
Member Author

First one. Very curious, using another computer with same OS now and here it works! Could I have enabled something special in the configuration? I will have to investigate.

Second one, yeah, maybe it was never concluded.
There is a setFocus line in Strip::setSelected that causes the DoubleLabel with Volume/Gain to be focused.
As I believe this is intentional (from Tim) I'm thinking of another solution, namely letting the DoubleLabel ignore space. As space is not used by the widget and just causes problems. I think that might work, I will check the other uses of DoubleLabel.

@kybos
Copy link
Contributor

kybos commented May 21, 2021

Could I have enabled something special in the configuration? I will have to investigate.

I see one setting related to focus ("Smart focus" in the GUI Tweaks), but I have no idea what it does (there is no tooltip or any other explanation).

@spamatica spamatica reopened this May 21, 2021
@terminator356
Copy link
Member

Yes, there is a tooltip and a what's this on that Settings button.

The purpose of smart focus is to return focus to respective canvas after editing any edit box.
With smart focus, after pressing enter or escape from inside an edit box, focus is returned to the relevant canvas.
Without smart focus the focus just stays there. Some folks prefer it that way, so it's a setting.

I reviewed the code.
You'll see that the above statements work with edit boxes on the toolbars and so on.
I respond to return and escape special signals from the boxes and go from there.

But it seems I never implemented return key handling for the double label in the mixer strips, although escape works. :-(
For the mixer strips, the scheme works slightly different than the toolbar boxes.
It uses a member in the Strip class called '_focusYieldWidget' which is set by calling Strip::setFocusYieldWidget().
For example the Arranger has code like this:

                    // Set focus yielding to the canvas.
                    if(MusEGlobal::config.smartFocus)
                      w->setFocusYieldWidget(canvas);

So when escape is pressed in Strip::keyPressEvent() it calls _focusYieldWidget->setFocus().

It's a simple concept. Guaranteeing 'yielding' focus to something other than some random higher-up parent
whenever focus is lost.
Keep that concept in mind when working in there, and you'll be fine.

@kybos
Copy link
Contributor

kybos commented May 22, 2021

Yes, there is a tooltip and a what's this on that Settings button.

You are right Tim, there is a Whatsthis text. I'll never get used to this...
The tooltip is there technically but shows only "Smart focus" (same as the checkbox label), so it's quite meaningless.

This whole tab with GUI Tweaks needs overhauling anyway, there are some other issues as well. I will try to improve the tooltips too, at least where I understand what the options mean.

I will remove the "Use old-style stop shortcut" if there are no objections. It's wrong in every respect IMO:

  • The text is not comprehensible for new users (what is "old-style"?).
  • I can see in the code that it's not about the stop shortcut (assigned to "Ins" by default) at all, but about the Play/Stop toggle (Space by default).
  • It conflicts with the "Rewind on stop" setting.

@spamatica
Copy link
Member Author

spamatica commented May 22, 2021

Old-style stop is a good example of changes/improvements in MusE where we left the old code as an option, if anyone really wanted to stick to the old. We should probably have been more decisive, removed the old and embraced the improvement. I can't believe anyone is actually using the old style. The simple truth that we tend to skip over is that more options equals more code to maintain. Usually resulting in some features having a half maintained status...
Stop being bound to Ins is that a new shortcut? I never knew about that one...

In a similar vein regarding SmartFocus, is this really an option we should keep around? I mean, what is the alternative, that it does not work well?
Edit: I mean that we can't turn it off, not that we remove smartfocus.

@kybos
Copy link
Contributor

kybos commented May 22, 2021

Stop being bound to Ins is that a new shortcut? I never knew about that one...

I don't think it's new, just hidden/neglected?
Maybe Insert is not the best key for it anyway, it would be better used for some more related action, like insert/add tracks or similar.

As for Smart focus, I never tried to disable it, so I don't know how it would behave.

@terminator356
Copy link
Member

I mean, what is the alternative, that it does not work well? Edit: I mean that we can't turn it off, not that we remove smartfocus.

No, the alternative is that we make it work well. Which it already does, except for the lack of return key handling
on some of the strip boxes. I'm looking into it.
Removing the option and leaving smart focus on permanently is not something I would like to do.
Some folks prefer standard behaviour - that focus stay where they put it even after hitting enter or escape.
That 'space key trick' would not work on some of the other boxes since they accept space.
Therefore giving the user a choice is the best way I could do it.
Otherwise without smart focus users have to manually click on the canvas again after editing a box.

@terminator356
Copy link
Member

@kybos Regarding what's this: We have a separate what's this button on some of our toolbars,
presumably to manually activate it if the window didn't have such a button.
But do I understand correctly that for WMs that do not have such a window button, having a manual
what's this button still would not work because the WM simply does not support displaying what's this at all,
and therefore manually calling the what's this features would still be useless and do nothing?
Shame, because there is a whole lot of useful text, some quite long, in a lot of our what's this code.
How could we reposition/repurpose that text in a useful way?
Are there no options other than directing users to a wiki or a help file?
Can you test the what's this button on our Arranger toolbar in Mint and see if works? Thanks.

@kybos
Copy link
Contributor

kybos commented May 22, 2021

Yes, the Whatsthis button and Shift+F1 do work in Cinnamon.
I'm just not used to using it, and I am somewhat skeptical about this kind of help in general. It was banned from MS Windows long time ago (with Vista I think). I understand that it was introduced in early Windows because there was no hover action at that time (to make proper tooltips possible). In Linux it seems to survive only in KDE apps, no app I normally use has it.
I'm afraid many people don't even know it exists.
So I fear all these useful Whatsthis texts in MusE are probably scarcely used, which would be really a shame.

I had a look at these texts already (as we'd had a similar discussion before). Most of them are quite short and could be probably easily converted to tooltips. There are only very few that are really long - for those we could create info buttons (or similar), either with link to the wiki, or open a separate info popup with the text. Or just keep them as Whatsthis...

@terminator356
Copy link
Member

I have made some fixes for this issue.
I removed the initial focus from the mixer strip volume boxes.
I fixed some related issues with Smart Focus.
Added Smart Focus to the four transport positional boxes on the toolbars.
Fixed Escape not restoring previous values on all boxes.
Fixed Return/Enter not yielding focus on some boxes.

Please keep in mind that when an editing box has focus, there is no guarantee that any or all shortcuts will work.
Especially space.
So remember to hit Return or Escape to lose the focus so that global shortcuts will work,
if Settings > Smart Focus is enabled (default enabled).

@spamatica
Copy link
Member Author

Alright, cool, will test as soon I can!

@github-actions
Copy link

This issue is stale because it has been inactive for two years. Remove Stale label or write a comment, otherwise it will be closed in 30 days.

@github-actions github-actions bot added the Stale label Jun 10, 2023
@github-actions
Copy link

Issue has been closed automatically after two years of inactivity. Feel free to reopen if the issue is still relevant for current MusE version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants