+ grab_keyboard(TRUE);
+}
+
+void moveresize_end(gboolean cancel)
+{
+ grab_keyboard(FALSE);
+ grab_pointer(FALSE, None);
+
+ popup_hide(popup);
+
+ if (moving) {
+ client_configure(moveresize_client, OB_CORNER_TOPLEFT,
+ (cancel ? start_cx : cur_x),
+ (cancel ? start_cy : cur_y),
+ start_cw, start_ch, TRUE, TRUE);
+ } 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()
+{
+ Rect *a;
+
+ dispatch_move(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);
+
+ /* this would be better with a fixed width font ... XXX can do it better
+ if there are 2 text boxes */
+ a = screen_area(screen_desktop);
+ popup_coords("X: %4d Y: %4d",
+ moveresize_client->frame->area.x - a->x,
+ moveresize_client->frame->area.y - a->y);
+}
+
+static void do_resize()
+{
+ /* dispatch_resize 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;
+
+ dispatch_resize(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 */
+ popup_coords("W: %4d H: %4d", moveresize_client->logical_size.width,
+ moveresize_client->logical_size.height);