Fix #51739: Sliding values in add primitive redo panel not hiding cursor

Cursor is actually wrapped at the beginning with the help of function
`WM_cursor_grab_enable`. Though the `ND_MODE` event notifier added
inside  `editmode_enter/exit_ex` further calls `region_cusor_set()`.
This resets the cursor to default at the bottom of
`ED_region_cursor_set()`. Such sitution could be avoided by creating a
dummy cursor function for hud region. But issue remains when we call
redo panel from F9. As Julian suggested, add condition for `grabcursor`
to avoid changing cursor when editing buttons.

Pull Request: https://projects.blender.org/blender/blender/pulls/133529
This commit is contained in:
Pratik Borhade
2025-07-04 12:01:03 +02:00
committed by Pratik Borhade
parent 841c36850c
commit eab747e8dd

View File

@@ -660,6 +660,10 @@ static void region_cursor_set(wmWindow *win, bool swin_changed)
{
bScreen *screen = WM_window_get_active_screen(win);
/* Don't touch cursor if something else is controling it, like button handling. See #51739. */
if (win->grabcursor) {
return;
}
ED_screen_areas_iter (win, screen, area) {
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
if (region == screen->active_region) {