+/*
+ * Resize the two given containers using the given amount of pixels or
+ * percentage points. One of the two needs to be 0. A positive amount means
+ * growing the first container while a negative means shrinking it.
+ * Returns false when the resize would result in one of the two containers
+ * having less than 1 pixel of size.
+ *
+ */
+bool resize_neighboring_cons(Con *first, Con *second, int px, int ppt) {
+ assert(px * ppt == 0);
+
+ Con *parent = first->parent;
+ double new_first_percent;
+ double new_second_percent;
+ if (ppt) {
+ new_first_percent = first->percent + ((double)ppt / 100.0);
+ new_second_percent = second->percent - ((double)ppt / 100.0);
+ } else {
+ new_first_percent = px_resize_to_percent(first, px);
+ new_second_percent = second->percent + first->percent - new_first_percent;
+ }
+ /* Ensure that no container will be less than 1 pixel in the resizing
+ * direction. */
+ if (new_first_percent < percent_for_1px(first) || new_second_percent < percent_for_1px(second)) {
+ return false;
+ }
+
+ first->percent = new_first_percent;
+ second->percent = new_second_percent;
+ con_fix_percent(parent);
+ return true;
+}
+
+void resize_graphical_handler(Con *first, Con *second, orientation_t orientation, const xcb_button_press_event_t *event) {