Cleanup: Use LISTBASE_FOREACH in editors/screen directory
Differential Revision: https://developer.blender.org/D8653
This commit is contained in:
		@@ -302,8 +302,6 @@ static void area_azone_tag_update(ScrArea *area)
 | 
			
		||||
 | 
			
		||||
static void region_draw_azones(ScrArea *area, ARegion *region)
 | 
			
		||||
{
 | 
			
		||||
  AZone *az;
 | 
			
		||||
 | 
			
		||||
  if (!area) {
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
@@ -314,7 +312,7 @@ static void region_draw_azones(ScrArea *area, ARegion *region)
 | 
			
		||||
  GPU_matrix_push();
 | 
			
		||||
  GPU_matrix_translate_2f(-region->winrct.xmin, -region->winrct.ymin);
 | 
			
		||||
 | 
			
		||||
  for (az = area->actionzones.first; az; az = az->next) {
 | 
			
		||||
  LISTBASE_FOREACH (AZone *, az, &area->actionzones) {
 | 
			
		||||
    /* test if action zone is over this region */
 | 
			
		||||
    rcti azrct;
 | 
			
		||||
    BLI_rcti_init(&azrct, az->x1, az->x2, az->y1, az->y2);
 | 
			
		||||
@@ -705,10 +703,8 @@ void ED_region_tag_redraw_partial(ARegion *region, const rcti *rct, bool rebuild
 | 
			
		||||
 | 
			
		||||
void ED_area_tag_redraw(ScrArea *area)
 | 
			
		||||
{
 | 
			
		||||
  ARegion *region;
 | 
			
		||||
 | 
			
		||||
  if (area) {
 | 
			
		||||
    for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
    LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
      ED_region_tag_redraw(region);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
@@ -716,10 +712,8 @@ void ED_area_tag_redraw(ScrArea *area)
 | 
			
		||||
 | 
			
		||||
void ED_area_tag_redraw_no_rebuild(ScrArea *area)
 | 
			
		||||
{
 | 
			
		||||
  ARegion *region;
 | 
			
		||||
 | 
			
		||||
  if (area) {
 | 
			
		||||
    for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
    LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
      ED_region_tag_redraw_no_rebuild(region);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
@@ -727,10 +721,8 @@ void ED_area_tag_redraw_no_rebuild(ScrArea *area)
 | 
			
		||||
 | 
			
		||||
void ED_area_tag_redraw_regiontype(ScrArea *area, int regiontype)
 | 
			
		||||
{
 | 
			
		||||
  ARegion *region;
 | 
			
		||||
 | 
			
		||||
  if (area) {
 | 
			
		||||
    for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
    LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
      if (region->regiontype == regiontype) {
 | 
			
		||||
        ED_region_tag_redraw(region);
 | 
			
		||||
      }
 | 
			
		||||
@@ -750,14 +742,12 @@ void ED_area_tag_refresh(ScrArea *area)
 | 
			
		||||
/* use NULL to disable it */
 | 
			
		||||
void ED_area_status_text(ScrArea *area, const char *str)
 | 
			
		||||
{
 | 
			
		||||
  ARegion *region;
 | 
			
		||||
 | 
			
		||||
  /* happens when running transform operators in background mode */
 | 
			
		||||
  if (area == NULL) {
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
  LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
    if (region->regiontype == RGN_TYPE_HEADER) {
 | 
			
		||||
      if (str) {
 | 
			
		||||
        if (region->headerstr == NULL) {
 | 
			
		||||
@@ -942,7 +932,6 @@ static void region_azone_edge(AZone *az, ARegion *region)
 | 
			
		||||
/* region already made zero sized, in shape of edge */
 | 
			
		||||
static void region_azone_tab_plus(ScrArea *area, AZone *az, ARegion *region)
 | 
			
		||||
{
 | 
			
		||||
  AZone *azt;
 | 
			
		||||
  int tot = 0, add;
 | 
			
		||||
  /* Edge offset multiplied by the  */
 | 
			
		||||
 | 
			
		||||
@@ -950,7 +939,7 @@ static void region_azone_tab_plus(ScrArea *area, AZone *az, ARegion *region)
 | 
			
		||||
  const float tab_size_x = 0.7f * U.widget_unit;
 | 
			
		||||
  const float tab_size_y = 0.4f * U.widget_unit;
 | 
			
		||||
 | 
			
		||||
  for (azt = area->actionzones.first; azt; azt = azt->next) {
 | 
			
		||||
  LISTBASE_FOREACH (AZone *, azt, &area->actionzones) {
 | 
			
		||||
    if (azt->edge == az->edge) {
 | 
			
		||||
      tot++;
 | 
			
		||||
    }
 | 
			
		||||
@@ -1846,7 +1835,6 @@ void ED_area_init(wmWindowManager *wm, wmWindow *win, ScrArea *area)
 | 
			
		||||
  WorkSpace *workspace = WM_window_get_active_workspace(win);
 | 
			
		||||
  const bScreen *screen = BKE_workspace_active_screen_get(win->workspace_hook);
 | 
			
		||||
  ViewLayer *view_layer = WM_window_get_active_view_layer(win);
 | 
			
		||||
  ARegion *region;
 | 
			
		||||
  rcti rect, overlap_rect;
 | 
			
		||||
  rcti window_rect;
 | 
			
		||||
 | 
			
		||||
@@ -1863,7 +1851,7 @@ void ED_area_init(wmWindowManager *wm, wmWindow *win, ScrArea *area)
 | 
			
		||||
    area->type = BKE_spacetype_from_id(area->spacetype);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
  LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
    region->type = BKE_regiontype_from_id_or_first(area->type, region->regiontype);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -1887,7 +1875,7 @@ void ED_area_init(wmWindowManager *wm, wmWindow *win, ScrArea *area)
 | 
			
		||||
  area_azone_init(win, screen, area);
 | 
			
		||||
 | 
			
		||||
  /* region windows, default and own handlers */
 | 
			
		||||
  for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
  LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
    region_subwindow(region);
 | 
			
		||||
 | 
			
		||||
    if (region->visible) {
 | 
			
		||||
@@ -2006,7 +1994,6 @@ void ED_region_toggle_hidden(bContext *C, ARegion *region)
 | 
			
		||||
void ED_area_data_copy(ScrArea *area_dst, ScrArea *area_src, const bool do_free)
 | 
			
		||||
{
 | 
			
		||||
  SpaceType *st;
 | 
			
		||||
  ARegion *region;
 | 
			
		||||
  const char spacetype = area_dst->spacetype;
 | 
			
		||||
  const short flag_copy = HEADER_NO_PULLDOWN;
 | 
			
		||||
 | 
			
		||||
@@ -2026,13 +2013,13 @@ void ED_area_data_copy(ScrArea *area_dst, ScrArea *area_src, const bool do_free)
 | 
			
		||||
  /* regions */
 | 
			
		||||
  if (do_free) {
 | 
			
		||||
    st = BKE_spacetype_from_id(spacetype);
 | 
			
		||||
    for (region = area_dst->regionbase.first; region; region = region->next) {
 | 
			
		||||
    LISTBASE_FOREACH (ARegion *, region, &area_dst->regionbase) {
 | 
			
		||||
      BKE_area_region_free(st, region);
 | 
			
		||||
    }
 | 
			
		||||
    BLI_freelistN(&area_dst->regionbase);
 | 
			
		||||
  }
 | 
			
		||||
  st = BKE_spacetype_from_id(area_src->spacetype);
 | 
			
		||||
  for (region = area_src->regionbase.first; region; region = region->next) {
 | 
			
		||||
  LISTBASE_FOREACH (ARegion *, region, &area_src->regionbase) {
 | 
			
		||||
    ARegion *newar = BKE_area_region_copy(st, region);
 | 
			
		||||
    BLI_addtail(&area_dst->regionbase, newar);
 | 
			
		||||
  }
 | 
			
		||||
@@ -2320,7 +2307,6 @@ void ED_area_newspace(bContext *C, ScrArea *area, int type, const bool skip_regi
 | 
			
		||||
  if (area->spacetype != type) {
 | 
			
		||||
    SpaceType *st;
 | 
			
		||||
    SpaceLink *slold = area->spacedata.first;
 | 
			
		||||
    SpaceLink *sl;
 | 
			
		||||
    /* store area->type->exit callback */
 | 
			
		||||
    void *area_exit = area->type ? area->type->exit : NULL;
 | 
			
		||||
    /* When the user switches between space-types from the type-selector,
 | 
			
		||||
@@ -2364,8 +2350,10 @@ void ED_area_newspace(bContext *C, ScrArea *area, int type, const bool skip_regi
 | 
			
		||||
     * (e.g. with properties editor) until space-data is properly created */
 | 
			
		||||
 | 
			
		||||
    /* check previously stored space */
 | 
			
		||||
    for (sl = area->spacedata.first; sl; sl = sl->next) {
 | 
			
		||||
      if (sl->spacetype == type) {
 | 
			
		||||
    SpaceLink *sl = NULL;
 | 
			
		||||
    LISTBASE_FOREACH (SpaceLink *, sl_iter, &area->spacedata) {
 | 
			
		||||
      if (sl_iter->spacetype == type) {
 | 
			
		||||
        sl = sl_iter;
 | 
			
		||||
        break;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
@@ -2714,7 +2702,7 @@ void ED_region_panels_layout_ex(const bContext *C,
 | 
			
		||||
  /* collect panels to draw */
 | 
			
		||||
  WorkSpace *workspace = CTX_wm_workspace(C);
 | 
			
		||||
  LinkNode *panel_types_stack = NULL;
 | 
			
		||||
  for (PanelType *pt = paneltypes->last; pt; pt = pt->prev) {
 | 
			
		||||
  LISTBASE_FOREACH_BACKWARD (PanelType *, pt, paneltypes) {
 | 
			
		||||
    /* Only draw top level panels. */
 | 
			
		||||
    if (pt->parent) {
 | 
			
		||||
      continue;
 | 
			
		||||
@@ -2991,7 +2979,6 @@ void ED_region_header_layout(const bContext *C, ARegion *region)
 | 
			
		||||
  const uiStyle *style = UI_style_get_dpi();
 | 
			
		||||
  uiBlock *block;
 | 
			
		||||
  uiLayout *layout;
 | 
			
		||||
  HeaderType *ht;
 | 
			
		||||
  Header header = {NULL};
 | 
			
		||||
  bool region_layout_based = region->flag & RGN_FLAG_DYNAMIC_SIZE;
 | 
			
		||||
 | 
			
		||||
@@ -3014,7 +3001,7 @@ void ED_region_header_layout(const bContext *C, ARegion *region)
 | 
			
		||||
  UI_view2d_view_ortho(®ion->v2d);
 | 
			
		||||
 | 
			
		||||
  /* draw all headers types */
 | 
			
		||||
  for (ht = region->type->headertypes.first; ht; ht = ht->next) {
 | 
			
		||||
  LISTBASE_FOREACH (HeaderType *, ht, ®ion->type->headertypes) {
 | 
			
		||||
    if (ht->poll && !ht->poll(C, ht)) {
 | 
			
		||||
      continue;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -204,7 +204,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
 | 
			
		||||
  }
 | 
			
		||||
  if (CTX_data_equals(member, "visible_bones") || CTX_data_equals(member, "editable_bones")) {
 | 
			
		||||
    bArmature *arm = (obedit && obedit->type == OB_ARMATURE) ? obedit->data : NULL;
 | 
			
		||||
    EditBone *ebone, *flipbone = NULL;
 | 
			
		||||
    EditBone *flipbone = NULL;
 | 
			
		||||
    const bool editable_bones = CTX_data_equals(member, "editable_bones");
 | 
			
		||||
 | 
			
		||||
    if (arm && arm->edbo) {
 | 
			
		||||
@@ -216,7 +216,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
 | 
			
		||||
        arm = ob->data;
 | 
			
		||||
 | 
			
		||||
        /* Attention: X-Axis Mirroring is also handled here... */
 | 
			
		||||
        for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
 | 
			
		||||
        LISTBASE_FOREACH (EditBone *, ebone, arm->edbo) {
 | 
			
		||||
          /* first and foremost, bone must be visible and selected */
 | 
			
		||||
          if (EBONE_VISIBLE(arm, ebone)) {
 | 
			
		||||
            /* Get 'x-axis mirror equivalent' bone if the X-Axis Mirroring option is enabled
 | 
			
		||||
@@ -262,7 +262,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
 | 
			
		||||
  if (CTX_data_equals(member, "selected_bones") ||
 | 
			
		||||
      CTX_data_equals(member, "selected_editable_bones")) {
 | 
			
		||||
    bArmature *arm = (obedit && obedit->type == OB_ARMATURE) ? obedit->data : NULL;
 | 
			
		||||
    EditBone *ebone, *flipbone = NULL;
 | 
			
		||||
    EditBone *flipbone = NULL;
 | 
			
		||||
    const bool selected_editable_bones = CTX_data_equals(member, "selected_editable_bones");
 | 
			
		||||
 | 
			
		||||
    if (arm && arm->edbo) {
 | 
			
		||||
@@ -274,7 +274,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
 | 
			
		||||
        arm = ob->data;
 | 
			
		||||
 | 
			
		||||
        /* Attention: X-Axis Mirroring is also handled here... */
 | 
			
		||||
        for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
 | 
			
		||||
        LISTBASE_FOREACH (EditBone *, ebone, arm->edbo) {
 | 
			
		||||
          /* first and foremost, bone must be visible and selected */
 | 
			
		||||
          if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_SELECTED)) {
 | 
			
		||||
            /* Get 'x-axis mirror equivalent' bone if the X-Axis Mirroring option is enabled
 | 
			
		||||
@@ -479,8 +479,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
 | 
			
		||||
  if (CTX_data_equals(member, "sequences")) {
 | 
			
		||||
    Editing *ed = BKE_sequencer_editing_get(scene, false);
 | 
			
		||||
    if (ed) {
 | 
			
		||||
      Sequence *seq;
 | 
			
		||||
      for (seq = ed->seqbasep->first; seq; seq = seq->next) {
 | 
			
		||||
      LISTBASE_FOREACH (Sequence *, seq, ed->seqbasep) {
 | 
			
		||||
        CTX_data_list_add(result, &scene->id, &RNA_Sequence, seq);
 | 
			
		||||
      }
 | 
			
		||||
      CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
 | 
			
		||||
@@ -491,8 +490,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
 | 
			
		||||
  if (CTX_data_equals(member, "selected_sequences")) {
 | 
			
		||||
    Editing *ed = BKE_sequencer_editing_get(scene, false);
 | 
			
		||||
    if (ed) {
 | 
			
		||||
      Sequence *seq;
 | 
			
		||||
      for (seq = ed->seqbasep->first; seq; seq = seq->next) {
 | 
			
		||||
      LISTBASE_FOREACH (Sequence *, seq, ed->seqbasep) {
 | 
			
		||||
        if (seq->flag & SELECT) {
 | 
			
		||||
          CTX_data_list_add(result, &scene->id, &RNA_Sequence, seq);
 | 
			
		||||
        }
 | 
			
		||||
@@ -505,8 +503,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
 | 
			
		||||
  if (CTX_data_equals(member, "selected_editable_sequences")) {
 | 
			
		||||
    Editing *ed = BKE_sequencer_editing_get(scene, false);
 | 
			
		||||
    if (ed) {
 | 
			
		||||
      Sequence *seq;
 | 
			
		||||
      for (seq = ed->seqbasep->first; seq; seq = seq->next) {
 | 
			
		||||
      LISTBASE_FOREACH (Sequence *, seq, ed->seqbasep) {
 | 
			
		||||
        if (seq->flag & SELECT && !(seq->flag & SEQ_LOCK)) {
 | 
			
		||||
          CTX_data_list_add(result, &scene->id, &RNA_Sequence, seq);
 | 
			
		||||
        }
 | 
			
		||||
@@ -520,16 +517,14 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
 | 
			
		||||
    bAnimContext ac;
 | 
			
		||||
    if (ANIM_animdata_get_context(C, &ac) != 0) {
 | 
			
		||||
      ListBase anim_data = {NULL, NULL};
 | 
			
		||||
      bAnimListElem *ale;
 | 
			
		||||
 | 
			
		||||
      ANIM_animdata_filter(&ac, &anim_data, ANIMFILTER_DATA_VISIBLE, ac.data, ac.datatype);
 | 
			
		||||
      for (ale = anim_data.first; ale; ale = ale->next) {
 | 
			
		||||
      LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
 | 
			
		||||
        if (ale->datatype != ALE_NLASTRIP) {
 | 
			
		||||
          continue;
 | 
			
		||||
        }
 | 
			
		||||
        NlaTrack *nlt = (NlaTrack *)ale->data;
 | 
			
		||||
        NlaStrip *strip;
 | 
			
		||||
        for (strip = nlt->strips.first; strip; strip = strip->next) {
 | 
			
		||||
        LISTBASE_FOREACH (NlaStrip *, strip, &nlt->strips) {
 | 
			
		||||
          if (strip->flag & NLASTRIP_FLAG_SELECT) {
 | 
			
		||||
            CTX_data_list_add(result, &scene->id, &RNA_NlaStrip, strip);
 | 
			
		||||
          }
 | 
			
		||||
@@ -637,9 +632,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
 | 
			
		||||
    bGPdata *gpd = ED_gpencil_data_get_active_direct(area, obact);
 | 
			
		||||
 | 
			
		||||
    if (gpd) {
 | 
			
		||||
      bGPDlayer *gpl;
 | 
			
		||||
 | 
			
		||||
      for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
 | 
			
		||||
      LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
 | 
			
		||||
        if ((gpl->flag & GP_LAYER_HIDE) == 0) {
 | 
			
		||||
          CTX_data_list_add(result, &gpd->id, &RNA_GPencilLayer, gpl);
 | 
			
		||||
        }
 | 
			
		||||
@@ -653,9 +646,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
 | 
			
		||||
    bGPdata *gpd = ED_gpencil_data_get_active_direct(area, obact);
 | 
			
		||||
 | 
			
		||||
    if (gpd) {
 | 
			
		||||
      bGPDlayer *gpl;
 | 
			
		||||
 | 
			
		||||
      for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
 | 
			
		||||
      LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
 | 
			
		||||
        if (BKE_gpencil_layer_is_editable(gpl)) {
 | 
			
		||||
          CTX_data_list_add(result, &gpd->id, &RNA_GPencilLayer, gpl);
 | 
			
		||||
        }
 | 
			
		||||
@@ -670,12 +661,9 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
 | 
			
		||||
    const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
 | 
			
		||||
 | 
			
		||||
    if (gpd) {
 | 
			
		||||
      bGPDlayer *gpl;
 | 
			
		||||
 | 
			
		||||
      for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
 | 
			
		||||
      LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
 | 
			
		||||
        if (BKE_gpencil_layer_is_editable(gpl) && (gpl->actframe)) {
 | 
			
		||||
          bGPDframe *gpf;
 | 
			
		||||
          bGPDstroke *gps;
 | 
			
		||||
          bGPDframe *init_gpf = gpl->actframe;
 | 
			
		||||
          if (is_multiedit) {
 | 
			
		||||
            init_gpf = gpl->frames.first;
 | 
			
		||||
@@ -683,7 +671,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
 | 
			
		||||
 | 
			
		||||
          for (gpf = init_gpf; gpf; gpf = gpf->next) {
 | 
			
		||||
            if ((gpf == gpl->actframe) || ((gpf->flag & GP_FRAME_SELECT) && (is_multiedit))) {
 | 
			
		||||
              for (gps = gpf->strokes.first; gps; gps = gps->next) {
 | 
			
		||||
              LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
 | 
			
		||||
                if (ED_gpencil_stroke_can_use_direct(area, gps)) {
 | 
			
		||||
                  /* check if the color is editable */
 | 
			
		||||
                  if (ED_gpencil_stroke_color_use(obact, gpl, gps) == false) {
 | 
			
		||||
 
 | 
			
		||||
@@ -379,11 +379,9 @@ void ED_screen_draw_edges(wmWindow *win)
 | 
			
		||||
  float col[4], corner_scale, edge_thickness;
 | 
			
		||||
  int verts_per_corner = 0;
 | 
			
		||||
 | 
			
		||||
  ScrArea *area;
 | 
			
		||||
 | 
			
		||||
  rcti scissor_rect;
 | 
			
		||||
  BLI_rcti_init_minmax(&scissor_rect);
 | 
			
		||||
  for (area = screen->areabase.first; area; area = area->next) {
 | 
			
		||||
  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
 | 
			
		||||
    BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){area->v1->vec.x, area->v1->vec.y});
 | 
			
		||||
    BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){area->v3->vec.x, area->v3->vec.y});
 | 
			
		||||
  }
 | 
			
		||||
@@ -418,7 +416,7 @@ void ED_screen_draw_edges(wmWindow *win)
 | 
			
		||||
  GPU_batch_uniform_1f(batch, "scale", corner_scale);
 | 
			
		||||
  GPU_batch_uniform_4fv(batch, "color", col);
 | 
			
		||||
 | 
			
		||||
  for (area = screen->areabase.first; area; area = area->next) {
 | 
			
		||||
  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
 | 
			
		||||
    drawscredge_area(area, winsize_x, winsize_y, edge_thickness);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -230,8 +230,7 @@ bScreen *screen_add(Main *bmain, const char *name, const rcti *rect)
 | 
			
		||||
 | 
			
		||||
void screen_data_copy(bScreen *to, bScreen *from)
 | 
			
		||||
{
 | 
			
		||||
  ScrVert *s1, *s2;
 | 
			
		||||
  ScrEdge *se;
 | 
			
		||||
  ScrVert *s2;
 | 
			
		||||
  ScrArea *area, *saf;
 | 
			
		||||
 | 
			
		||||
  /* free contents of 'to', is from blenkernel screen.c */
 | 
			
		||||
@@ -245,11 +244,11 @@ void screen_data_copy(bScreen *to, bScreen *from)
 | 
			
		||||
  BLI_listbase_clear(&to->regionbase);
 | 
			
		||||
 | 
			
		||||
  s2 = to->vertbase.first;
 | 
			
		||||
  for (s1 = from->vertbase.first; s1; s1 = s1->next, s2 = s2->next) {
 | 
			
		||||
  for (ScrVert *s1 = from->vertbase.first; s1; s1 = s1->next, s2 = s2->next) {
 | 
			
		||||
    s1->newv = s2;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  for (se = to->edgebase.first; se; se = se->next) {
 | 
			
		||||
  LISTBASE_FOREACH (ScrEdge *, se, &to->edgebase) {
 | 
			
		||||
    se->v1 = se->v1->newv;
 | 
			
		||||
    se->v2 = se->v2->newv;
 | 
			
		||||
    BKE_screen_sort_scrvert(&(se->v1), &(se->v2));
 | 
			
		||||
@@ -271,7 +270,7 @@ void screen_data_copy(bScreen *to, bScreen *from)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /* put at zero (needed?) */
 | 
			
		||||
  for (s1 = from->vertbase.first; s1; s1 = s1->next) {
 | 
			
		||||
  LISTBASE_FOREACH (ScrVert *, s1, &from->vertbase) {
 | 
			
		||||
    s1->newv = NULL;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@@ -538,9 +537,7 @@ void ED_screen_refresh(wmWindowManager *wm, wmWindow *win)
 | 
			
		||||
/* file read, set all screens, ... */
 | 
			
		||||
void ED_screens_init(Main *bmain, wmWindowManager *wm)
 | 
			
		||||
{
 | 
			
		||||
  wmWindow *win;
 | 
			
		||||
 | 
			
		||||
  for (win = wm->windows.first; win; win = win->next) {
 | 
			
		||||
  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
 | 
			
		||||
    if (BKE_workspace_active_get(win->workspace_hook) == NULL) {
 | 
			
		||||
      BKE_workspace_active_set(win->workspace_hook, bmain->workspaces.first);
 | 
			
		||||
    }
 | 
			
		||||
@@ -552,7 +549,7 @@ void ED_screens_init(Main *bmain, wmWindowManager *wm)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (U.uiflag & USER_HEADER_FROM_PREF) {
 | 
			
		||||
    for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
 | 
			
		||||
    LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
 | 
			
		||||
      BKE_screen_header_alignment_reset(screen);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
@@ -614,7 +611,6 @@ void ED_area_exit(bContext *C, ScrArea *area)
 | 
			
		||||
  wmWindowManager *wm = CTX_wm_manager(C);
 | 
			
		||||
  wmWindow *win = CTX_wm_window(C);
 | 
			
		||||
  ScrArea *prevsa = CTX_wm_area(C);
 | 
			
		||||
  ARegion *region;
 | 
			
		||||
 | 
			
		||||
  if (area->type && area->type->exit) {
 | 
			
		||||
    area->type->exit(wm, area);
 | 
			
		||||
@@ -622,7 +618,7 @@ void ED_area_exit(bContext *C, ScrArea *area)
 | 
			
		||||
 | 
			
		||||
  CTX_wm_area_set(C, area);
 | 
			
		||||
 | 
			
		||||
  for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
  LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
    ED_region_exit(C, region);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -683,10 +679,11 @@ static void screen_cursor_set(wmWindow *win, const int xy[2])
 | 
			
		||||
{
 | 
			
		||||
  const bScreen *screen = WM_window_get_active_screen(win);
 | 
			
		||||
  AZone *az = NULL;
 | 
			
		||||
  ScrArea *area;
 | 
			
		||||
  ScrArea *area = NULL;
 | 
			
		||||
 | 
			
		||||
  for (area = screen->areabase.first; area; area = area->next) {
 | 
			
		||||
    if ((az = ED_area_actionzone_find_xy(area, xy))) {
 | 
			
		||||
  LISTBASE_FOREACH (ScrArea *, area_iter, &screen->areabase) {
 | 
			
		||||
    if ((az = ED_area_actionzone_find_xy(area_iter, xy))) {
 | 
			
		||||
      area = area_iter;
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
@@ -733,7 +730,6 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2])
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ScrArea *area = NULL;
 | 
			
		||||
  ARegion *region;
 | 
			
		||||
  ARegion *region_prev = screen->active_region;
 | 
			
		||||
 | 
			
		||||
  ED_screen_areas_iter (win, screen, area_iter) {
 | 
			
		||||
@@ -750,7 +746,7 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2])
 | 
			
		||||
  }
 | 
			
		||||
  if (area) {
 | 
			
		||||
    /* Make overlap active when mouse over. */
 | 
			
		||||
    for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
    LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
      if (ED_region_contains_xy(region, xy)) {
 | 
			
		||||
        screen->active_region = region;
 | 
			
		||||
        break;
 | 
			
		||||
@@ -767,8 +763,7 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2])
 | 
			
		||||
    ED_screen_areas_iter (win, screen, area_iter) {
 | 
			
		||||
      bool do_draw = false;
 | 
			
		||||
 | 
			
		||||
      for (region = area_iter->regionbase.first; region; region = region->next) {
 | 
			
		||||
 | 
			
		||||
      LISTBASE_FOREACH (ARegion *, region, &area_iter->regionbase) {
 | 
			
		||||
        /* Call old area's deactivate if assigned. */
 | 
			
		||||
        if (region == region_prev && area_iter->type->deactivate) {
 | 
			
		||||
          area_iter->type->deactivate(area_iter);
 | 
			
		||||
@@ -789,7 +784,7 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2])
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (do_draw) {
 | 
			
		||||
        for (region = area_iter->regionbase.first; region; region = region->next) {
 | 
			
		||||
        LISTBASE_FOREACH (ARegion *, region, &area_iter->regionbase) {
 | 
			
		||||
          if (ELEM(region->regiontype, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER)) {
 | 
			
		||||
            ED_region_tag_redraw_no_rebuild(region);
 | 
			
		||||
          }
 | 
			
		||||
@@ -826,13 +821,12 @@ int ED_screen_area_active(const bContext *C)
 | 
			
		||||
 | 
			
		||||
  if (win && screen && area) {
 | 
			
		||||
    AZone *az = ED_area_actionzone_find_xy(area, &win->eventstate->x);
 | 
			
		||||
    ARegion *region;
 | 
			
		||||
 | 
			
		||||
    if (az && az->type == AZONE_REGION) {
 | 
			
		||||
      return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
    LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
      if (region == screen->active_region) {
 | 
			
		||||
        return 1;
 | 
			
		||||
      }
 | 
			
		||||
@@ -883,10 +877,10 @@ static void screen_global_area_refresh(wmWindow *win,
 | 
			
		||||
                                       const short height_min,
 | 
			
		||||
                                       const short height_max)
 | 
			
		||||
{
 | 
			
		||||
  ScrArea *area;
 | 
			
		||||
 | 
			
		||||
  for (area = win->global_areas.areabase.first; area; area = area->next) {
 | 
			
		||||
    if (area->spacetype == space_type) {
 | 
			
		||||
  ScrArea *area = NULL;
 | 
			
		||||
  LISTBASE_FOREACH (ScrArea *, area_iter, &win->global_areas.areabase) {
 | 
			
		||||
    if (area_iter->spacetype == space_type) {
 | 
			
		||||
      area = area_iter;
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
@@ -1081,7 +1075,6 @@ static void screen_set_3dview_camera(Scene *scene,
 | 
			
		||||
    v3d->camera = BKE_view_layer_camera_find(view_layer);
 | 
			
		||||
    // XXX if (screen == curscreen) handle_view3d_lock();
 | 
			
		||||
    if (!v3d->camera) {
 | 
			
		||||
      ARegion *region;
 | 
			
		||||
      ListBase *regionbase;
 | 
			
		||||
 | 
			
		||||
      /* regionbase is in different place depending if space is active */
 | 
			
		||||
@@ -1092,7 +1085,7 @@ static void screen_set_3dview_camera(Scene *scene,
 | 
			
		||||
        regionbase = &v3d->regionbase;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      for (region = regionbase->first; region; region = region->next) {
 | 
			
		||||
      LISTBASE_FOREACH (ARegion *, region, regionbase) {
 | 
			
		||||
        if (region->regiontype == RGN_TYPE_WINDOW) {
 | 
			
		||||
          RegionView3D *rv3d = region->regiondata;
 | 
			
		||||
          if (rv3d->persp == RV3D_CAMOB) {
 | 
			
		||||
@@ -1240,13 +1233,12 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *area, const
 | 
			
		||||
  wmWindowManager *wm = CTX_wm_manager(C);
 | 
			
		||||
  WorkSpace *workspace = WM_window_get_active_workspace(win);
 | 
			
		||||
  bScreen *screen, *oldscreen;
 | 
			
		||||
  ARegion *region;
 | 
			
		||||
 | 
			
		||||
  if (area) {
 | 
			
		||||
    /* ensure we don't have a button active anymore, can crash when
 | 
			
		||||
     * switching screens with tooltip open because region and tooltip
 | 
			
		||||
     * are no longer in the same screen */
 | 
			
		||||
    for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
    LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
      UI_blocklist_free(C, ®ion->uiblocks);
 | 
			
		||||
 | 
			
		||||
      if (region->regiontimer) {
 | 
			
		||||
@@ -1299,7 +1291,7 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *area, const
 | 
			
		||||
        glob_area->global->flag &= ~GLOBAL_AREA_IS_HIDDEN;
 | 
			
		||||
      }
 | 
			
		||||
      /* restore the old side panels/header visibility */
 | 
			
		||||
      for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
      LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
        region->flag = region->flagfullscreen;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
@@ -1364,7 +1356,7 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *area, const
 | 
			
		||||
        glob_area->global->flag |= GLOBAL_AREA_IS_HIDDEN;
 | 
			
		||||
      }
 | 
			
		||||
      /* temporarily hide the side panels/header */
 | 
			
		||||
      for (region = newa->regionbase.first; region; region = region->next) {
 | 
			
		||||
      LISTBASE_FOREACH (ARegion *, region, &newa->regionbase) {
 | 
			
		||||
        region->flagfullscreen = region->flag;
 | 
			
		||||
 | 
			
		||||
        if (ELEM(region->regiontype,
 | 
			
		||||
@@ -1537,13 +1529,11 @@ void ED_screen_animation_timer(bContext *C, int redraws, int sync, int enable)
 | 
			
		||||
static ARegion *time_top_left_3dwindow(bScreen *screen)
 | 
			
		||||
{
 | 
			
		||||
  ARegion *aret = NULL;
 | 
			
		||||
  ScrArea *area;
 | 
			
		||||
  int min = 10000;
 | 
			
		||||
 | 
			
		||||
  for (area = screen->areabase.first; area; area = area->next) {
 | 
			
		||||
  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
 | 
			
		||||
    if (area->spacetype == SPACE_VIEW3D) {
 | 
			
		||||
      ARegion *region;
 | 
			
		||||
      for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
      LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
        if (region->regiontype == RGN_TYPE_WINDOW) {
 | 
			
		||||
          if (region->winrct.xmin - region->winrct.ymin < min) {
 | 
			
		||||
            aret = region;
 | 
			
		||||
@@ -1581,10 +1571,9 @@ void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph)
 | 
			
		||||
#ifdef DURIAN_CAMERA_SWITCH
 | 
			
		||||
  void *camera = BKE_scene_camera_switch_find(scene);
 | 
			
		||||
  if (camera && scene->camera != camera) {
 | 
			
		||||
    bScreen *screen;
 | 
			
		||||
    scene->camera = camera;
 | 
			
		||||
    /* are there cameras in the views that are not in the scene? */
 | 
			
		||||
    for (screen = bmain->screens.first; screen; screen = screen->id.next) {
 | 
			
		||||
    LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
 | 
			
		||||
      BKE_screen_view3d_scene_sync(screen, scene);
 | 
			
		||||
    }
 | 
			
		||||
    DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
 | 
			
		||||
@@ -1602,10 +1591,9 @@ void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph)
 | 
			
		||||
 */
 | 
			
		||||
bool ED_screen_stereo3d_required(const bScreen *screen, const Scene *scene)
 | 
			
		||||
{
 | 
			
		||||
  ScrArea *area;
 | 
			
		||||
  const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0;
 | 
			
		||||
 | 
			
		||||
  for (area = screen->areabase.first; area; area = area->next) {
 | 
			
		||||
  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
 | 
			
		||||
    switch (area->spacetype) {
 | 
			
		||||
      case SPACE_VIEW3D: {
 | 
			
		||||
        View3D *v3d;
 | 
			
		||||
@@ -1616,8 +1604,7 @@ bool ED_screen_stereo3d_required(const bScreen *screen, const Scene *scene)
 | 
			
		||||
 | 
			
		||||
        v3d = area->spacedata.first;
 | 
			
		||||
        if (v3d->camera && v3d->stereo3d_camera == STEREO_3D_ID) {
 | 
			
		||||
          ARegion *region;
 | 
			
		||||
          for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
          LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
            if (region->regiondata && region->regiontype == RGN_TYPE_WINDOW) {
 | 
			
		||||
              RegionView3D *rv3d = region->regiondata;
 | 
			
		||||
              if (rv3d->persp == RV3D_CAMOB) {
 | 
			
		||||
 
 | 
			
		||||
@@ -162,7 +162,6 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *screen)
 | 
			
		||||
 | 
			
		||||
  const int screen_size_x = BLI_rcti_size_x(&screen_rect);
 | 
			
		||||
  const int screen_size_y = BLI_rcti_size_y(&screen_rect);
 | 
			
		||||
  ScrVert *sv = NULL;
 | 
			
		||||
  int screen_size_x_prev, screen_size_y_prev;
 | 
			
		||||
  float min[2], max[2];
 | 
			
		||||
 | 
			
		||||
@@ -170,7 +169,7 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *screen)
 | 
			
		||||
  min[0] = min[1] = 20000.0f;
 | 
			
		||||
  max[0] = max[1] = 0.0f;
 | 
			
		||||
 | 
			
		||||
  for (sv = screen->vertbase.first; sv; sv = sv->next) {
 | 
			
		||||
  LISTBASE_FOREACH (ScrVert *, sv, &screen->vertbase) {
 | 
			
		||||
    const float fv[2] = {(float)sv->vec.x, (float)sv->vec.y};
 | 
			
		||||
    minmax_v2v2_v2(min, max, fv);
 | 
			
		||||
  }
 | 
			
		||||
@@ -183,7 +182,7 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *screen)
 | 
			
		||||
    const float facy = ((float)screen_size_y - 1) / ((float)screen_size_y_prev - 1);
 | 
			
		||||
 | 
			
		||||
    /* make sure it fits! */
 | 
			
		||||
    for (sv = screen->vertbase.first; sv; sv = sv->next) {
 | 
			
		||||
    LISTBASE_FOREACH (ScrVert *, sv, &screen->vertbase) {
 | 
			
		||||
      sv->vec.x = screen_rect.xmin + round_fl_to_short((sv->vec.x - min[0]) * facx);
 | 
			
		||||
      CLAMP(sv->vec.x, screen_rect.xmin, screen_rect.xmax - 1);
 | 
			
		||||
 | 
			
		||||
@@ -208,7 +207,7 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *screen)
 | 
			
		||||
            screen_geom_select_connected_edge(win, se);
 | 
			
		||||
 | 
			
		||||
            /* all selected vertices get the right offset */
 | 
			
		||||
            for (sv = screen->vertbase.first; sv; sv = sv->next) {
 | 
			
		||||
            LISTBASE_FOREACH (ScrVert *, sv, &screen->vertbase) {
 | 
			
		||||
              /* if is a collapsed area */
 | 
			
		||||
              if (sv != area->v1 && sv != area->v4) {
 | 
			
		||||
                if (sv->flag) {
 | 
			
		||||
@@ -232,7 +231,7 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *screen)
 | 
			
		||||
            screen_geom_select_connected_edge(win, se);
 | 
			
		||||
 | 
			
		||||
            /* all selected vertices get the right offset */
 | 
			
		||||
            for (sv = screen->vertbase.first; sv; sv = sv->next) {
 | 
			
		||||
            LISTBASE_FOREACH (ScrVert *, sv, &screen->vertbase) {
 | 
			
		||||
              /* if is not a collapsed area */
 | 
			
		||||
              if (sv != area->v2 && sv != area->v3) {
 | 
			
		||||
                if (sv->flag) {
 | 
			
		||||
 
 | 
			
		||||
@@ -692,10 +692,9 @@ static bool actionzone_area_poll(bContext *C)
 | 
			
		||||
 | 
			
		||||
  if (screen && win && win->eventstate) {
 | 
			
		||||
    const int *xy = &win->eventstate->x;
 | 
			
		||||
    AZone *az;
 | 
			
		||||
 | 
			
		||||
    LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
 | 
			
		||||
      for (az = area->actionzones.first; az; az = az->next) {
 | 
			
		||||
      LISTBASE_FOREACH (AZone *, az, &area->actionzones) {
 | 
			
		||||
        if (BLI_rcti_isect_pt_v(&az->rect, xy)) {
 | 
			
		||||
          return 1;
 | 
			
		||||
        }
 | 
			
		||||
@@ -3068,13 +3067,12 @@ static void SCREEN_OT_keyframe_jump(wmOperatorType *ot)
 | 
			
		||||
static int marker_jump_exec(bContext *C, wmOperator *op)
 | 
			
		||||
{
 | 
			
		||||
  Scene *scene = CTX_data_scene(C);
 | 
			
		||||
  TimeMarker *marker;
 | 
			
		||||
  int closest = CFRA;
 | 
			
		||||
  const bool next = RNA_boolean_get(op->ptr, "next");
 | 
			
		||||
  bool found = false;
 | 
			
		||||
 | 
			
		||||
  /* find matching marker in the right direction */
 | 
			
		||||
  for (marker = scene->markers.first; marker; marker = marker->next) {
 | 
			
		||||
  LISTBASE_FOREACH (TimeMarker *, marker, &scene->markers) {
 | 
			
		||||
    if (next) {
 | 
			
		||||
      if ((marker->frame > CFRA) && (!found || closest > marker->frame)) {
 | 
			
		||||
        closest = marker->frame;
 | 
			
		||||
@@ -3170,8 +3168,9 @@ static int screen_maximize_area_exec(bContext *C, wmOperator *op)
 | 
			
		||||
 | 
			
		||||
  /* search current screen for 'fullscreen' areas */
 | 
			
		||||
  /* prevents restoring info header, when mouse is over it */
 | 
			
		||||
  for (area = screen->areabase.first; area; area = area->next) {
 | 
			
		||||
    if (area->full) {
 | 
			
		||||
  LISTBASE_FOREACH (ScrArea *, area_iter, &screen->areabase) {
 | 
			
		||||
    if (area_iter->full) {
 | 
			
		||||
      area = area_iter;
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
@@ -3619,12 +3618,10 @@ static void SCREEN_OT_area_options(wmOperatorType *ot)
 | 
			
		||||
static int spacedata_cleanup_exec(bContext *C, wmOperator *op)
 | 
			
		||||
{
 | 
			
		||||
  Main *bmain = CTX_data_main(C);
 | 
			
		||||
  bScreen *screen;
 | 
			
		||||
  ScrArea *area;
 | 
			
		||||
  int tot = 0;
 | 
			
		||||
 | 
			
		||||
  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
 | 
			
		||||
    for (area = screen->areabase.first; area; area = area->next) {
 | 
			
		||||
  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
 | 
			
		||||
    LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
 | 
			
		||||
      if (area->spacedata.first != area->spacedata.last) {
 | 
			
		||||
        SpaceLink *sl = area->spacedata.first;
 | 
			
		||||
 | 
			
		||||
@@ -3854,7 +3851,6 @@ static int region_quadview_exec(bContext *C, wmOperator *op)
 | 
			
		||||
    region->alignment = 0;
 | 
			
		||||
 | 
			
		||||
    if (area->spacetype == SPACE_VIEW3D) {
 | 
			
		||||
      ARegion *region_iter;
 | 
			
		||||
      RegionView3D *rv3d = region->regiondata;
 | 
			
		||||
 | 
			
		||||
      /* if this is a locked view, use settings from 'User' view */
 | 
			
		||||
@@ -3878,7 +3874,7 @@ static int region_quadview_exec(bContext *C, wmOperator *op)
 | 
			
		||||
      rv3d->rflag |= RV3D_GPULIGHT_UPDATE;
 | 
			
		||||
 | 
			
		||||
      /* Accumulate locks, in case they're mixed. */
 | 
			
		||||
      for (region_iter = area->regionbase.first; region_iter; region_iter = region_iter->next) {
 | 
			
		||||
      LISTBASE_FOREACH (ARegion *, region_iter, &area->regionbase) {
 | 
			
		||||
        if (region_iter->regiontype == RGN_TYPE_WINDOW) {
 | 
			
		||||
          RegionView3D *rv3d_iter = region_iter->regiondata;
 | 
			
		||||
          rv3d->viewlock_quad |= rv3d_iter->viewlock;
 | 
			
		||||
@@ -4441,8 +4437,6 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv
 | 
			
		||||
    wmTimer *wt = screen->animtimer;
 | 
			
		||||
    ScreenAnimData *sad = wt->customdata;
 | 
			
		||||
    wmWindowManager *wm = CTX_wm_manager(C);
 | 
			
		||||
    wmWindow *window;
 | 
			
		||||
    ScrArea *area;
 | 
			
		||||
    int sync;
 | 
			
		||||
    double time;
 | 
			
		||||
 | 
			
		||||
@@ -4588,12 +4582,11 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv
 | 
			
		||||
      ED_update_for_newframe(bmain, depsgraph);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (window = wm->windows.first; window; window = window->next) {
 | 
			
		||||
    LISTBASE_FOREACH (wmWindow *, window, &wm->windows) {
 | 
			
		||||
      const bScreen *win_screen = WM_window_get_active_screen(window);
 | 
			
		||||
 | 
			
		||||
      for (area = win_screen->areabase.first; area; area = area->next) {
 | 
			
		||||
        ARegion *region;
 | 
			
		||||
        for (region = area->regionbase.first; region; region = region->next) {
 | 
			
		||||
      LISTBASE_FOREACH (ScrArea *, area, &win_screen->areabase) {
 | 
			
		||||
        LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
 | 
			
		||||
          bool redraw = false;
 | 
			
		||||
          if (region == sad->region) {
 | 
			
		||||
            redraw = true;
 | 
			
		||||
@@ -4867,8 +4860,9 @@ static int fullscreen_back_exec(bContext *C, wmOperator *op)
 | 
			
		||||
  ScrArea *area = NULL;
 | 
			
		||||
 | 
			
		||||
  /* search current screen for 'fullscreen' areas */
 | 
			
		||||
  for (area = screen->areabase.first; area; area = area->next) {
 | 
			
		||||
  LISTBASE_FOREACH (ScrArea *, area_iter, &screen->areabase) {
 | 
			
		||||
    if (area->full) {
 | 
			
		||||
      area = area_iter;
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -409,8 +409,7 @@ static void workspace_add_menu(bContext *UNUSED(C), uiLayout *layout, void *temp
 | 
			
		||||
  WorkspaceConfigFileData *builtin_config = workspace_system_file_read(app_template);
 | 
			
		||||
 | 
			
		||||
  if (startup_config) {
 | 
			
		||||
    for (WorkSpace *workspace = startup_config->workspaces.first; workspace;
 | 
			
		||||
         workspace = workspace->id.next) {
 | 
			
		||||
    LISTBASE_FOREACH (WorkSpace *, workspace, &startup_config->workspaces) {
 | 
			
		||||
      uiLayout *row = uiLayoutRow(layout, false);
 | 
			
		||||
      workspace_append_button(row, ot_append, workspace, startup_config->main);
 | 
			
		||||
      has_startup_items = true;
 | 
			
		||||
@@ -420,8 +419,7 @@ static void workspace_add_menu(bContext *UNUSED(C), uiLayout *layout, void *temp
 | 
			
		||||
  if (builtin_config) {
 | 
			
		||||
    bool has_title = false;
 | 
			
		||||
 | 
			
		||||
    for (WorkSpace *workspace = builtin_config->workspaces.first; workspace;
 | 
			
		||||
         workspace = workspace->id.next) {
 | 
			
		||||
    LISTBASE_FOREACH (WorkSpace *, workspace, &builtin_config->workspaces) {
 | 
			
		||||
      if (startup_config &&
 | 
			
		||||
          BLI_findstring(&startup_config->workspaces, workspace->id.name, offsetof(ID, name))) {
 | 
			
		||||
        continue;
 | 
			
		||||
 
 | 
			
		||||
@@ -168,8 +168,7 @@ static bool workspace_change_find_new_layout_cb(const WorkSpaceLayout *layout, v
 | 
			
		||||
 | 
			
		||||
static bScreen *screen_fullscreen_find_associated_normal_screen(const Main *bmain, bScreen *screen)
 | 
			
		||||
{
 | 
			
		||||
  for (bScreen *screen_iter = bmain->screens.first; screen_iter;
 | 
			
		||||
       screen_iter = screen_iter->id.next) {
 | 
			
		||||
  LISTBASE_FOREACH (bScreen *, screen_iter, &bmain->screens) {
 | 
			
		||||
    if ((screen_iter != screen) && ELEM(screen_iter->state, SCREENMAXIMIZED, SCREENFULL)) {
 | 
			
		||||
      ScrArea *area = screen_iter->areabase.first;
 | 
			
		||||
      if (area && area->full == screen) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user