-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Added hysteresis for popup sub-menus #41851
Added hysteresis for popup sub-menus #41851
Conversation
255813c
to
f15cbbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are already doing it based on Windows, the options should get highlighted immediately after hover not after timeout. Otherwise they feel unresponsive.
Also, this is less important, but double-nested submenus don't work correctly:
(this is the attached project from my old PR)
This is similar to the problem with my old PR which I never fixed. It's probably fine if you don't fix this either (i.e. leave for another PR), as editor doesn't use double-nested popups anyways.
Other than that the implementation is fine. The timeout feels a bit too long, but this might be because I'm using debug build.
@KoBeWi I have fixed the first part. It was a bit of a mess about because of how a submenu would grab focus when it was opened. Now by default it doesn't. It only grabs focus when mouse enters it, which means that the behaviour in your first GIF is fixed. Some adjustments were also made in As for the second issue... it is really confusing. Sometimes it happens, sometimes it doesn't. It seems very inconsistent and I cannot determine the cause of why it happens. During debugging it seems that the top level popupmenu gets I also reduced the delay time to 0.3 seconds, to match the submenu popup timer. |
f15cbbc
to
c5ccb56
Compare
c5ccb56
to
d471044
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The get_close_on_parent_focus()
is probably unnecessary as it's never used. Also not sure if you should mix style changes into this PR (the p_over
stuff), at least in one commit.
Other than that, this looks fine now.
This adds a small lag effect when opening submenus which allow the user to move directly to an item on the submenu without worrying about avoiding the autohide regions.
d471044
to
c482e8e
Compare
Updated. Yes, the |
Thanks! |
From my testing it looks like this introduced #70361. |
This adds a small lag effect when opening submenus which allow the user to move directly to an item on the submenu without worrying about avoiding the autohide regions.
I tested with Windows 10 submenu's and seems like their timer is just under 0.5 seconds, so that is what I used. The timer only starts when the user enters an autohide area for the first time. Again, this simulates the behaviour I observed on Windows 10. Please note this is a delay-only based implementation. I am not doing any fancy mouse-movement tracking or prediction - that's overkill imo.
Builds on #41640
Closes #11219
Supersedes/Closes #35487
CC @KoBeWi
Note how in the below GIF I actually enter autohide areas on my way to the submenu, but it does not close.