[Bf-blender-cvs] [62ba16d7c45] master: Fix for the Python console not setting the cursor

Campbell Barton noreply at git.blender.org
Mon Nov 25 12:52:43 CET 2019


Commit: 62ba16d7c45083fc2b1d61f39cfe20e78896cfcd
Author: Campbell Barton
Date:   Mon Nov 25 22:49:44 2019 +1100
Branches: master
https://developer.blender.org/rB62ba16d7c45083fc2b1d61f39cfe20e78896cfcd

Fix for the Python console not setting the cursor

===================================================================

M	source/blender/editors/space_console/space_console.c

===================================================================

diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index 65a23531963..207f508d4ee 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -146,13 +146,11 @@ static void console_main_region_init(wmWindowManager *wm, ARegion *ar)
 }
 
 /* same as 'text_cursor' */
-static void console_cursor(wmWindow *win, ScrArea *sa, ARegion *ar)
+static void console_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion *ar)
 {
-  SpaceText *st = sa->spacedata.first;
   int wmcursor = WM_CURSOR_TEXT_EDIT;
-
-  if (st->text &&
-      BLI_rcti_isect_pt(&st->txtbar, win->eventstate->x - ar->winrct.xmin, st->txtbar.ymin)) {
+  const wmEvent *event = win->eventstate;
+  if (UI_view2d_mouse_in_scrollers(ar, &ar->v2d, event->x, event->y)) {
     wmcursor = WM_CURSOR_DEFAULT;
   }
 
@@ -330,6 +328,7 @@ void ED_spacetype_console(void)
   art->init = console_main_region_init;
   art->draw = console_main_region_draw;
   art->cursor = console_cursor;
+  art->event_cursor = true;
   art->listener = console_main_region_listener;
 
   BLI_addhead(&st->regiontypes, art);



More information about the Bf-blender-cvs mailing list