+ grab_keyboard(TRUE);
+}
+
+static void end_moveresize(gboolean cancel)
+{
+ grab_keyboard(FALSE);
+ grab_pointer(FALSE, None);
+
+ XDestroyWindow(ob_display, coords);
+ coords = None;
+
+ moveresize_in_progress = FALSE;
+
+ if (moving) {
+ client_configure(client, Corner_TopLeft, (cancel ? start_cx : cur_x),
+ (cancel ? start_cy : cur_y),
+ start_cw, start_ch, TRUE, TRUE);
+ } else {
+ client_configure(client, lockcorner, client->area.x,
+ client->area.y, (cancel ? start_cw : cur_x),
+ (cancel ? start_ch : cur_y), TRUE, TRUE);
+ }
+}
+
+static void do_move()
+{
+ dispatch_move(client, &cur_x, &cur_y);
+
+ popup_coords("X: %d Y: %d", cur_x, cur_y);
+
+ /* get where the client should be */
+ frame_frame_gravity(client->frame, &cur_x, &cur_y);
+ client_configure(client, Corner_TopLeft, cur_x, cur_y,
+ start_cw, start_ch, TRUE, FALSE);
+}
+
+static void do_resize()
+{
+ /* dispatch_resize needs the frame size */
+ cur_x += client->frame->size.left + client->frame->size.right;
+ cur_y += client->frame->size.top + client->frame->size.bottom;
+
+ dispatch_resize(client, &cur_x, &cur_y, lockcorner);
+
+ cur_x -= client->frame->size.left + client->frame->size.right;
+ cur_y -= client->frame->size.top + client->frame->size.bottom;
+
+ client_configure(client, lockcorner, client->area.x,
+ client->area.y, cur_x, cur_y, TRUE, FALSE);
+
+ popup_coords("W: %d H: %d", client->logical_size.width,
+ client->logical_size.height);