+/*+-------------------------------------------------------------------------
+ Compute the intersection rectangle of two overlapping rectangles
+---------------------------------------------------------------------------*/
+#define COMPUTE_INTERSECTION(pan1,pan2,ix1,ix2,iy1,iy2)\
+ ix1 = (PSTARTX(pan1) < PSTARTX(pan2)) ? PSTARTX(pan2) : PSTARTX(pan1);\
+ ix2 = (PENDX(pan1) < PENDX(pan2)) ? PENDX(pan1) : PENDX(pan2);\
+ iy1 = (PSTARTY(pan1) < PSTARTY(pan2)) ? PSTARTY(pan2) : PSTARTY(pan1);\
+ iy2 = (PENDY(pan1) < PENDY(pan2)) ? PENDY(pan1) : PENDY(pan2);\
+ assert((ix1<=ix2) && (iy1<=iy2));\
+
+
+/*+-------------------------------------------------------------------------
+ Walk through the panel stack starting at the given location and
+ check for intersections; overlapping panels are "touched", so they
+ are incrementally overwriting cells that should be hidden.
+ If the "touch" flag is set, the panel gets touched before it is
+ updated.
+---------------------------------------------------------------------------*/
+#define PANEL_UPDATE(pan,panstart,touch)\
+{ PANEL* pan2 = ((panstart) ? (panstart) : _nc_bottom_panel);\
+ if (touch)\