+void do_unsqueeze(WRegion *reg)
+{
+ WSizeHints h;
+ WRegion *mgr=REGION_MANAGER(reg);
+
+ if(OBJ_IS(reg, WScreen))
+ return;
+
+ region_size_hints(reg, &h);
+
+ if(!h.min_set)
+ return;
+
+ if(h.min_width<=REGION_GEOM(reg).w &&
+ h.min_height<=REGION_GEOM(reg).h){
+ return;
+ }
+
+ ioncore_detach(reg, SETPARAM_SET);
+
+ if(REGION_MANAGER(reg)==mgr)
+ return;
+
+ do_unsqueeze(reg);
+}
+
+
+/*EXTL_DOC
+ * Try to detach \var{reg} if it fits poorly in its
+ * current location. This function does not do anything,
+ * unless \var{override} is set or the \var{unsqueeze} option
+ * of \fnref{ioncore.set} is set.
+ */
+EXTL_EXPORT
+void ioncore_unsqueeze(WRegion *reg, bool override)
+{
+ if(ioncore_g.unsqueeze_enabled || override)
+ do_unsqueeze(region_groupleader_of(reg));
+}
+
+