- if (config) {
- client_find_onscreen(client, &x, &y, w, h, FALSE);
- client_configure(client, x, y, w, h, FALSE, TRUE);
+ if (move || resize || border) {
+ gint lw,lh;
+
+ if (move || resize) {
+ client_try_configure(client, &x, &y, &w, &h, &lw, &lh, FALSE);
+
+ /* if x was not given, then use gravity to figure out the new
+ x. the reference point should not be moved */
+ if ((e->xconfigurerequest.value_mask & CWWidth &&
+ !(e->xconfigurerequest.value_mask & CWX)))
+ client_gravity_resize_w(client, &x, client->area.width, w);
+ /* if y was not given, then use gravity to figure out the new
+ y. the reference point should not be moved */
+ if ((e->xconfigurerequest.value_mask & CWHeight &&
+ !(e->xconfigurerequest.value_mask & CWY)))
+ client_gravity_resize_h(client, &y, client->area.height,h);
+
+ client_find_onscreen(client, &x, &y, w, h, FALSE);
+ }
+ /* if they requested something that moves the window, or if
+ the window is actually being changed then configure it and
+ send a configure notify to them */
+ if (move || !RECT_EQUAL_DIMS(client->area, x, y, w, h) ||
+ border)
+ {
+ ob_debug("Granting ConfigureRequest x %d y %d w %d h %d "
+ "b %d\n",
+ x, y, w, h, b);
+ client_configure(client, x, y, w, h, b, FALSE, TRUE);
+ }