During an earthquake, the detachment and local interaction between infill wall panels and surrounding frame can occur, potentially leading to significant local damage to both structural and non-structural elements, if not global collapse. Yet, a procedure to assess the relative deformation mechanism in terms of detachment shape and values, rather than, and in addition to, the diagonal compression strut mechanism and associated internal panel strain and stress path, is still missing in the literature. Therefore, in this paper the concept of shape functions is proposed and adopted to assess the seismic displacement incompatibility between infill walls and the surrounding frame structure. A parametric study on different typologies of infilled frames is developed to investigate the key parameters affecting the infill-frame detachment. The proposed concept of shape functions can support the design/retrofit of improved construction details, such as shear keys and/or steel dowels, in view of either decoupling or strengthening retrofit/repair strategies. Moreover, as infill-frame detachment can lead to damage to energy enhancement rehabilitation solutions, such as external thermal insulation systems, which are becoming more common nowadays in view of the international target towards a significant reduction of energy consumption and CO2 emission, it is suggested to implement the proposed displacement-compatible design check to assess and detail for adequate displacement capacity.