Fix #137386: UI: Show Default Dursor in Paint Mode Menus and Dialogs
Ensure the use of the default mouse pointer cursor in paint mode dialogs and menus by checking for temporary regions before setting the "dot" cursor. Pull Request: https://projects.blender.org/blender/blender/pulls/137793
This commit is contained in:
committed by
Harley Acheson
parent
83f5480be0
commit
9b8be181ba
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_math_axis_angle.hh"
|
||||
#include "BLI_math_matrix.hh"
|
||||
#include "BLI_math_rotation.h"
|
||||
@@ -1243,6 +1244,7 @@ struct PaintCursorContext {
|
||||
ARegion *region;
|
||||
wmWindow *win;
|
||||
wmWindowManager *wm;
|
||||
bScreen *screen;
|
||||
Depsgraph *depsgraph;
|
||||
Scene *scene;
|
||||
UnifiedPaintSettings *ups;
|
||||
@@ -1311,6 +1313,7 @@ static bool paint_cursor_context_init(bContext *C,
|
||||
pcontext.region = region;
|
||||
pcontext.wm = CTX_wm_manager(C);
|
||||
pcontext.win = CTX_wm_window(C);
|
||||
pcontext.screen = CTX_wm_screen(C);
|
||||
pcontext.depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
pcontext.scene = CTX_data_scene(C);
|
||||
pcontext.ups = &pcontext.scene->toolsettings->unified_paint_settings;
|
||||
@@ -1455,6 +1458,17 @@ static void paint_update_mouse_cursor(PaintCursorContext &pcontext)
|
||||
* with the UI (dragging a number button for e.g.), see: #102792. */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Don't set the cursor when a temporary popup is opened (e.g. a context menu, pie menu or
|
||||
* dialog), see: #137386. */
|
||||
if (!BLI_listbase_is_empty(&pcontext.screen->regionbase)) {
|
||||
LISTBASE_FOREACH (ARegion *, region, &pcontext.screen->regionbase) {
|
||||
if (region->regiontype == RGN_TYPE_TEMPORARY) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ELEM(pcontext.mode, PaintMode::GPencil, PaintMode::VertexGPencil)) {
|
||||
WM_cursor_set(pcontext.win, WM_CURSOR_DOT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user