Allow preview region to change cursor as per the selected tool
Details
Diff Detail
- Repository
- rB Blender
Event Timeline
Seq_region_cursor does not follow naming scheme in the file, would rather use sequencer_region_cursor. Also tref_rt and cursor could be const.
But the functionality seems to be too hard-coded - it would be impossible to implement tool with same cursor in timeline area?
But the functionality seems to be too hard-coded - it would be impossible to implement tool with same cursor in timeline area?
@Richard Antalik (ISS) hi, I did not understand this completely. You mean the change made in this patch?
Yes, with this change, if you change cursor of blade tool to PAINT_BRUSH, it would not work.
@Richard Antalik (ISS), if you change cursor of any other tool to PAINT_BRUSH of sequencer-editor, this patch will treat all of them in same way.
I mean in your case, pencil cursor will appear in preview region for blade tool. And default cursor in all other regions of sequencer editor.
I'm particularly following this approach because preview regions are not allowed to have cursor other than WM_CURSOR_DEFAULT. see: T88617#1465845
You and Campbell might have a smarter way of fixing this. Feel free to submit the fix in that case :)
This is too hard-coded, to properly fix this the tool would need to store the region-type it applies to as it does for space-type.
For now this seems like a reasonable workaround, e.g.
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index f7c030db1cd..74e760013fd 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -173,7 +173,7 @@ void WM_cursor_set(wmWindow *win, int curs) bool WM_cursor_set_from_tool(struct wmWindow *win, const ScrArea *area, const ARegion *region) { - if (region && (region->regiontype != RGN_TYPE_WINDOW)) { + if (region && !ELEM(region->regiontype, RGN_TYPE_WINDOW, RGN_TYPE_PREVIEW)) { return false; }
Replace hardcoded logic to allow preview region to change cursor type as per the selected tool