-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
UI: Hide mouse cursor option #1307
Conversation
I hope this gets merged soon... |
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.
I like the feature, but it needs some minor changes before being merged
ui/xui/main.cc
Outdated
@@ -252,6 +252,9 @@ void xemu_hud_render(void) | |||
ShowMainMenu(); | |||
ImGui::PopStyleColor(); | |||
} else { | |||
if (g_config.display.ui.hide_cursor && !g_scene_mgr.IsDisplayingScene()) { |
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.
Because of where this is placed, this hides the cursor only if the menu bar is shown. What if the menu bar is configured to be hidden also? This code will never trigger and the mouse cursor will not be hidden in this case.
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 agree i can add a simple check on the alpha state of the menu bar with an OR, so i can either check this, or if the bar has become invisible to hide the cursor, so if you check the hide bar option, it can hide the cursor based directly on that state, and it won't conflict with the menu open since then the menu state is active
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.
We don't need to consider the alpha state of the menu bar. Just hide the cursor if it is not being moved after some period of time.
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.
I've reworked the code, but i still have to figure out how to add a small delay after the cursor stopped moving before hiding the cursor.
Fixes #825
Hides the cursor when option is enabled and outside of UI:
2023-01-13.00-32-33.mp4