Revision: 76788
          http://sourceforge.net/p/brlcad/code/76788
Author:   starseeker
Date:     2020-08-15 14:25:49 +0000 (Sat, 15 Aug 2020)
Log Message:
-----------
The background color setting was getting a ged_gvp set by calling set_curr_dm, 
even though that's not what we want in that case.  Work around the issue, but 
MGED's state management will need some thought going forward.

Modified Paths:
--------------
    brlcad/trunk/src/libged/ged.c
    brlcad/trunk/src/mged/color_scheme.c

Modified: brlcad/trunk/src/libged/ged.c
===================================================================
--- brlcad/trunk/src/libged/ged.c       2020-08-15 14:14:30 UTC (rev 76787)
+++ brlcad/trunk/src/libged/ged.c       2020-08-15 14:25:49 UTC (rev 76788)
@@ -294,7 +294,7 @@
     gedp->ged_io_data = NULL;
 
     /* Out of the gate we don't have display managers or views */
-    gedp->ged_gvp = NULL;
+    gedp->ged_gvp = GED_VIEW_NULL;
     gedp->ged_dmp = NULL;
 
     /* ? */

Modified: brlcad/trunk/src/mged/color_scheme.c
===================================================================
--- brlcad/trunk/src/mged/color_scheme.c        2020-08-15 14:14:30 UTC (rev 
76787)
+++ brlcad/trunk/src/mged/color_scheme.c        2020-08-15 14:25:49 UTC (rev 
76788)
@@ -295,6 +295,13 @@
                  color_scheme->cs_bg[1],
                  color_scheme->cs_bg[2]);
 
+    // set_curr_dm will update ged_gvp, but we don't
+    // want that here - stash the current ged_gvp
+    // state.  Need to rethink how we're managing
+    // the notion of the "current" dm in situations
+    // where we act on all dm instances.  set_curr_dm
+    // should probably be replaced with get_next_dm
+    struct bview *cbv = GEDP->ged_gvp;
     FOR_ALL_DISPLAYS(dmlp, &head_dm_list.l) {
        if (dmlp->dml_color_scheme == color_scheme) {
            dmlp->dml_dirty = 1;
@@ -305,6 +312,7 @@
 
     bu_vls_free(&vls);
     set_curr_dm(save_curr_dmlp);
+    GEDP->ged_gvp = cbv;
 }
 
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to