* outputs.
*
*/
-void floating_reposition(Con *con, Rect newrect);
+bool floating_reposition(Con *con, Rect newrect);
/**
* Sets size of the CT_FLOATING_CON to specified dimensions. Might limit the
newrect.x = x;
newrect.y = y;
- floating_reposition(current->con->parent, newrect);
+ if (!floating_reposition(current->con->parent, newrect)) {
+ yerror("Cannot move window/container out of bounds.");
+ has_error = true;
+ }
}
- // XXX: default reply for now, make this a better reply
if (!has_error)
ysuccess(true);
}
* outputs.
*
*/
-void floating_reposition(Con *con, Rect newrect) {
+bool floating_reposition(Con *con, Rect newrect) {
/* Sanity check: Are the new coordinates on any output? If not, we
* ignore that request. */
if (!contained_by_output(newrect)) {
ELOG("No output found at destination coordinates. Not repositioning.\n");
- return;
+ return false;
}
con->rect = newrect;
con->scratchpad_state = SCRATCHPAD_CHANGED;
tree_render();
+ return true;
}
/*