+ grab_keyboard(TRUE);
+}
+
+void moveresize_end(gboolean cancel)
+{
+ grab_keyboard(FALSE);
+ grab_pointer(FALSE, OB_CURSOR_NONE);
+
+ popup_hide(popup);
+
+ if (moving) {
+ client_move(moveresize_client,
+ (cancel ? start_cx : cur_x),
+ (cancel ? start_cy : cur_y));
+ } else {
+ client_configure(moveresize_client, lockcorner,
+ moveresize_client->area.x,
+ moveresize_client->area.y,
+ (cancel ? start_cw : cur_x),
+ (cancel ? start_ch : cur_y), TRUE, TRUE);
+ }
+
+ moveresize_in_progress = FALSE;
+ moveresize_client = NULL;
+}
+
+static void do_move(gboolean resist)
+{
+ if (resist)
+ resist_move_windows(moveresize_client, &cur_x, &cur_y);
+ resist_move_monitors(moveresize_client, &cur_x, &cur_y);
+
+ /* get where the client should be */
+ frame_frame_gravity(moveresize_client->frame, &cur_x, &cur_y);
+ client_configure(moveresize_client, OB_CORNER_TOPLEFT, cur_x, cur_y,
+ start_cw, start_ch, TRUE, FALSE);
+}
+
+static void do_resize(gboolean resist)
+{
+ /* resist_size_* needs the frame size */
+ cur_x += moveresize_client->frame->size.left +
+ moveresize_client->frame->size.right;
+ cur_y += moveresize_client->frame->size.top +
+ moveresize_client->frame->size.bottom;
+
+ if (resist)
+ resist_size_windows(moveresize_client, &cur_x, &cur_y, lockcorner);
+ resist_size_monitors(moveresize_client, &cur_x, &cur_y, lockcorner);
+
+ cur_x -= moveresize_client->frame->size.left +
+ moveresize_client->frame->size.right;
+ cur_y -= moveresize_client->frame->size.top +
+ moveresize_client->frame->size.bottom;
+
+ client_configure(moveresize_client, lockcorner,
+ moveresize_client->area.x, moveresize_client->area.y,
+ cur_x, cur_y, TRUE, FALSE);
+
+ /* this would be better with a fixed width font ... XXX can do it better
+ if there are 2 text boxes */
+ if (moveresize_client->size_inc.width > 1 ||
+ moveresize_client->size_inc.height > 1)
+ popup_coords(moveresize_client, "%d x %d",
+ moveresize_client->logical_size.width,
+ moveresize_client->logical_size.height);