Commit: f0815b1322dc4f04dd949fd92049a99479e5f61d
Author: Campbell Barton
Date:   Thu Jun 7 16:45:10 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBf0815b1322dc4f04dd949fd92049a99479e5f61d

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/windowmanager/WM_api.h
index 21e050e8e14,75b2cfffd03..267aa448dc3
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@@ -142,7 -104,10 +142,7 @@@ enum 
  struct wmWindow       *WM_window_open(struct bContext *C, const struct rcti 
*rect);
  struct wmWindow *WM_window_open_temp(struct bContext *C, int x, int y, int 
sizex, int sizey, int type);
  void             WM_window_set_dpi(wmWindow *win);
-                       
+ 
 -                      /* returns true if draw method is triple buffer */
 -bool          WM_is_draw_triple(struct wmWindow *win);
 -
  bool          WM_stereo3d_enabled(struct wmWindow *win, bool 
only_fullscreen_test);
  
  
diff --cc source/blender/windowmanager/WM_types.h
index 81018348ca0,298c5184ced..856694276a9
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@@ -211,14 -199,15 +211,14 @@@ typedef enum eOperatorPropTags 
  
  typedef struct wmNotifier {
        struct wmNotifier *next, *prev;
-       
+ 
        struct wmWindowManager *wm;
        struct wmWindow *window;
-       
+ 
 -      int swinid;                     /* can't rely on this, notifiers can be 
added without context, swinid of 0 */
        unsigned int category, data, subtype, action;
-       
+ 
        void *reference;
-       
+ 
  } wmNotifier;
  
  
diff --cc source/blender/windowmanager/intern/wm.c
index 9100e47d820,98d9edb9f94..6a42bf26a97
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@@ -372,10 -359,10 +372,10 @@@ void WM_keymap_init(bContext *C
                wm->addonconf = WM_keyconfig_new(wm, "Blender Addon");
        if (!wm->userconf)
                wm->userconf = WM_keyconfig_new(wm, "Blender User");
-       
+ 
        /* initialize only after python init is done, for keymaps that
         * use python operators */
 -      if (CTX_py_init_get(C) && (wm->initialized & WM_INIT_KEYMAP) == 0) {
 +      if (CTX_py_init_get(C) && (wm->initialized & WM_KEYMAP_IS_INITIALIZED) 
== 0) {
                /* create default key config, only initialize once,
                 * it's persistent across sessions */
                if (!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) {
@@@ -487,10 -467,11 +487,10 @@@ void wm_close_and_free(bContext *C, wmW
                wm_autosave_timer_ended(wm);
  
        while ((win = BLI_pophead(&wm->windows))) {
 -              win->screen = NULL; /* prevent draw clear to use screen */
 -              wm_draw_window_clear(win);
 +              WM_window_set_active_workspace(win, NULL); /* prevent draw 
clear to use screen */
                wm_window_free(C, wm, win);
        }
-       
+ 
        while ((op = BLI_pophead(&wm->operators))) {
                WM_operator_free(op);
        }
diff --cc source/blender/windowmanager/intern/wm_cursors.c
index 67b04662154,6aef38a320b..f13dac9cb4c
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@@ -41,8 -41,7 +41,8 @@@
  #include "BLI_sys_types.h"
  
  #include "DNA_listBase.h"
- #include "DNA_userdef_types.h" 
+ #include "DNA_userdef_types.h"
 +#include "DNA_workspace_types.h"
  
  #include "BKE_context.h"
  #include "BKE_global.h"
diff --cc source/blender/windowmanager/intern/wm_dragdrop.c
index 319ce99f700,7a5e3e90166..16ed51cbd80
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@@ -365,10 -361,10 +365,10 @@@ void wm_drags_draw(bContext *C, wmWindo
                        drag_rect_minmax(rect, x, y, x + w, y + iconsize);
                }
                else {
 -                      glColor4ub(255, 255, 255, 255);
 -                      UI_fontstyle_draw_simple(fstyle, x, y, 
wm_drag_name(drag));
 +                      const unsigned char col[] = {255, 255, 255, 255};
 +                      UI_fontstyle_draw_simple(fstyle, x, y, 
wm_drag_name(drag), col);
                }
-               
+ 
                /* operator name with roundbox */
                if (drag->opname[0]) {
                        if (drag->imb) {
diff --cc source/blender/windowmanager/intern/wm_draw.c
index 3ce64926a95,b9f44a00df7..df958f35e91
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@@ -801,12 -967,16 +801,12 @@@ void wm_draw_update(bContext *C
                        continue;
                }
  #endif
 -              if (win->drawmethod != U.wmdrawmethod) {
 -                      wm_draw_window_clear(win);
 -                      win->drawmethod = U.wmdrawmethod;
 -              }
  
                if (wm_draw_update_test_window(win)) {
 -                      bScreen *screen = win->screen;
 +                      bScreen *screen = WM_window_get_active_screen(win);
  
                        CTX_wm_window_set(C, win);
-                       
+ 
                        /* sets context window+screen */
                        wm_window_make_drawable(wm, win);
  
diff --cc source/blender/windowmanager/intern/wm_event_system.c
index 31b51fce858,7c81f836bc1..b95eb099cce
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@@ -194,12 -190,16 +194,12 @@@ void WM_event_add_notifier(const bConte
                return;
  
        note = MEM_callocN(sizeof(wmNotifier), "notifier");
-       
+ 
        note->wm = wm;
        BLI_addtail(&note->wm->queue, note);
-       
+ 
        note->window = CTX_wm_window(C);
-       
+ 
 -      ar = CTX_wm_region(C);
 -      if (ar)
 -              note->swinid = ar->swinid;
 -
        note->category = type & NOTE_CATEGORY;
        note->data = type & NOTE_DATA;
        note->subtype = type & NOTE_SUBTYPE;
@@@ -357,15 -331,12 +357,15 @@@ void wm_event_do_notifiers(bContext *C
        if (wm == NULL)
                return;
  
 +      /* disable? - keep for now since its used for window level notifiers. */
 +#if 1
        /* cache & catch WM level notifiers, such as frame change, scene/screen 
set */
        for (win = wm->windows.first; win; win = win->next) {
 +              Scene *scene = WM_window_get_active_scene(win);
                bool do_anim = false;
-               
+ 
                CTX_wm_window_set(C, win);
-               
+ 
                for (note = wm->queue.first; note; note = next) {
                        next = note->next;
  
@@@ -484,19 -424,9 +484,19 @@@
                                }
                        }
                }
-               
+ 
                MEM_freeN(note);
        }
 +#endif /* if 1 (postpone disabling for in favor of message-bus), eventually. 
*/
 +
 +      /* Handle message bus. */
 +      {
 +              for (win = wm->windows.first; win; win = win->next) {
 +                      CTX_wm_window_set(C, win);
 +                      WM_msgbus_handle(wm->message_bus, C);
 +              }
 +              CTX_wm_window_set(C, NULL);
 +      }
  
        wm_event_do_refresh_wm_and_depsgraph(C);
  }
@@@ -1466,12 -1355,12 +1466,12 @@@ static int wm_operator_call_internal
                                        if (ar1)
                                                CTX_wm_region_set(C, ar1);
                                }
-                               
+ 
 -                              retval = wm_operator_invoke(C, ot, event, 
properties, reports, poll_only);
 +                              retval = wm_operator_invoke(C, ot, event, 
properties, reports, poll_only, true);
-                               
+ 
                                /* set region back */
                                CTX_wm_region_set(C, ar);
-                               
+ 
                                return retval;
                        }
                        case WM_OP_EXEC_AREA:
@@@ -1503,10 -1392,10 +1503,10 @@@
                        }
                        case WM_OP_EXEC_DEFAULT:
                        case WM_OP_INVOKE_DEFAULT:
 -                              return wm_operator_invoke(C, ot, event, 
properties, reports, poll_only);
 +                              return wm_operator_invoke(C, ot, event, 
properties, reports, poll_only, true);
                }
        }
-       
+ 
        return 0;
  }
  
@@@ -1600,9 -1489,8 +1600,9 @@@ void wm_event_free_handler(wmEventHandl
  /* only set context when area/region is part of screen */
  static void wm_handler_op_context(bContext *C, wmEventHandler *handler, const 
wmEvent *event)
  {
 +      wmWindow *win = CTX_wm_window(C);
        bScreen *screen = CTX_wm_screen(C);
-       
+ 
        if (screen && handler->op) {
                if (handler->op_area == NULL)
                        CTX_wm_area_set(C, NULL);
@@@ -1975,21 -1826,9 +1975,21 @@@ static int wm_handler_operator_call(bCo
        else {
                wmOperatorType *ot = WM_operatortype_find(event->keymap_idname, 
0);
  
 -              if (ot) {
 -                      if (wm_operator_check_locked_interface(C, ot)) {
 -                              retval = wm_operator_invoke(C, ot, event, 
properties, NULL, false);
 +              if (ot && wm_operator_check_locked_interface(C, ot)) {
 +                      bool use_last_properties = true;
 +                      PointerRNA tool_properties = {{0}};
 +                      bool use_tool_properties = (handler->keymap_tool != 
NULL);
-                       
++
 +                      if (use_tool_properties) {
 +                              
WM_toolsystem_ref_properties_init_for_keymap(handler->keymap_tool, 
&tool_properties, properties, ot);
 +                              properties = &tool_properties;
 +                              use_last_properties = false;
 +                      }
 +
 +                      retval = wm_operator_invoke(C, ot, event, properties, 
NULL, false, use_last_properties);
 +
 +                      if (use_tool_properties) {
 +                              WM_operator_properties_free(&tool_properties);
                        }
                }
        }
@@@ -2272,7 -2109,6 +2272,7 @@@ static int wm_handlers_do_intern(bConte
                                                        event->keymap_idname = 
kmi->idname;
  
                                                        action |= 
wm_handler_operator_call(C, handlers, handler, event, kmi->ptr);
-                                                       
++
                                                        if (action & 
WM_HANDLER_BREAK) {
                                                                /* not 
always_pass here, it denotes removed handler */
                                                                
CLOG_INFO(WM_LOG_HANDLERS, 2, "handled! '%s'", kmi->idname);
@@@ -2593,15 -2288,13 +2593,15 @@@ static int wm_event_inside_i(wmEvent *e
  
  static ScrArea *area_event_inside(bContext *C, const int xy[2])
  {
 +      wmWindow *win = CTX_wm_window(C);
        bScreen *screen = CTX_wm_screen(C);
-       
 -      ScrArea *sa;
+ 
 -      if (screen)
 -              for (sa = screen->areabase.first; sa; sa = sa->next)
 +      if (screen) {
 +              ED_screen_areas_iter(win, screen, sa) {
                        if (BLI_rcti_isect_pt_v(&sa->totrct, xy))
                                return sa;
 +              }
 +      }
        return NULL;
  }
  
@@@ -2664,9 -2355,9 +2664,9 @@@ static void wm_event_drag_test(wmWindow
        if (BLI_listbase_is_empty(&wm->drags)) {
                return;
        }
-       
+ 
        if (event->type == MOUSEMOVE || ISKEYMODIFIER(event->type)) {
 -              win->screen->do_draw_drag = true;
 +              screen->do_draw_drag = true;
        }
        else if (event->type == ESCKEY) {
                WM_drag_free_list(&wm->drags);
@@@ -2685,10 -2376,10 +2685,10 @@@
                event->custom = EVT_DATA_DRAGDROP;
                event->customdata = &wm->drags;
                event->customdatafree = 1;
-               
+ 
                /* clear drop icon */
 -              win->screen->do_draw_drag = true;
 +              screen->do_draw_drag = true;
-               
+ 
                /* restore cursor (disabled, see wm_dragdrop.c) */
                // WM_cursor_modal_restore(win);
        }
@@@ -2720,30 -2417,24 +2720,30 @@@ void wm_event_do_handlers(bContext *C
  
        /* update key configuration before handling events */
        WM_keyconfig_update(wm);
 +      WM_manipulatorconfig_update(CTX_data_main(C));
  
        for (win = wm->windows.first; win; win = win->next) {
 +              bScreen *screen = WM_window_get_active_screen(win);
                wmEvent *event;
  
 -              if (win->screen == NULL)
 +              /* some safty checks - these should always be set! */
 +              BLI_assert(WM_window_get_active_scene(win));
 +              BLI_assert(WM_window_get_active_screen(win));
 +              BLI_assert(WM_window_get_active_workspace(win));
 +
 +              i

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to