+ /* override the client's max state if desired */
+ if (ABS(dw) >= config_resist_edge) {
+ if (moveresize_client->max_horz) {
+ /* unmax horz */
+ was_max_horz = TRUE;
+ pre_max_area.x = moveresize_client->pre_max_area.x;
+ pre_max_area.width = moveresize_client->pre_max_area.width;
+
+ moveresize_client->pre_max_area.x = cur_x;
+ moveresize_client->pre_max_area.width = cur_w;
+ client_maximize(moveresize_client, FALSE, 1);
+ }
+ }
+ else if (was_max_horz && !moveresize_client->max_horz) {
+ /* remax horz and put the premax back */
+ client_maximize(moveresize_client, TRUE, 1);
+ moveresize_client->pre_max_area.x = pre_max_area.x;
+ moveresize_client->pre_max_area.width = pre_max_area.width;
+ }
+
+ if (ABS(dh) >= config_resist_edge) {
+ if (moveresize_client->max_vert) {
+ /* unmax vert */
+ was_max_vert = TRUE;
+ pre_max_area.y = moveresize_client->pre_max_area.y;
+ pre_max_area.height =
+ moveresize_client->pre_max_area.height;
+
+ moveresize_client->pre_max_area.y = cur_y;
+ moveresize_client->pre_max_area.height = cur_h;
+ client_maximize(moveresize_client, FALSE, 2);
+ }
+ }
+ else if (was_max_vert && !moveresize_client->max_vert) {
+ /* remax vert and put the premax back */
+ client_maximize(moveresize_client, TRUE, 2);
+ moveresize_client->pre_max_area.y = pre_max_area.y;
+ moveresize_client->pre_max_area.height = pre_max_area.height;
+ }
+