A major problem of window-based stereo matching lies in selecting appropriate window size and shape. A window must be large enough to include enough intensity variation for reliable matching, but small enough not to include the depth discontinuity. Most of the previous approaches use a window which frequently includes an intensity edge. Unfortunately an intensity edge frequently coincides with the depth discontinuity. For this reason, it is not easy to find a trade-off between the richness of intensity variation and the avoidance of the depth discontinuity. In this paper we propose a new algorithm which constructs a distinct window through the all-plausibility check. We first enlarge the window in the low contrast region until no more all-plausible set of pixels is found. If the window is distinct, we stop enlarging the window and uniquely determine the disparity using the distinct window. We propose a modified membrane equation to propagate the disparity into the pixels which do not belong to any all-plausible set. Various test images were used for the experiment, and our algorithm gives good results for its simplicity.