diff -wcrBEb -x '*.o' -x xfwm4 -x '.*' -x 'Makefile*' -x '*icon*' -t '--tabsize=4' xfwm4/src/client.c xfce/xfwm4/src/client.c *** xfwm4/src/client.c 2013-01-08 19:12:13.427518928 +0100 --- xfce/xfwm4/src/client.c 2013-01-08 19:09:04.606514546 +0100 *************** *** 3200,3205 **** --- 3200,3249 ---- return (wc->height <= c->size->max_height); } + //CLIENT_FLAG_TILED_CORNER + { + switch(tile) + { + case TILE_UP_LEFT: + tmp_x = full_x; + tmp_y = full_y; + tmp_w = full_w / 2; + tmp_h = full_h / 2; + clientMaxSpace (screen_info, &tmp_x, &full_y, &tmp_w, &full_h); + break; + case TILE_UP_RIGHT: + tmp_x = full_x + full_w/2; + tmp_y = full_y; + tmp_w = full_w / 2; + tmp_h = full_h / 2; + clientMaxSpace (screen_info, &tmp_x, &full_y, &tmp_w, &full_h); + break; + case TILE_DOWN_LEFT: + tmp_x = full_x; + tmp_y = full_y + full_h/2; + tmp_w = full_w / 2; + tmp_h = full_h / 2; + clientMaxSpace (screen_info, &tmp_x, &full_y, &tmp_w, &full_h); + break; + case TILE_DOWN_RIGHT: + tmp_x = full_x + full_w/2; + tmp_y = full_y + full_h/2; + tmp_w = full_w / 2; + tmp_h = full_h / 2; + clientMaxSpace (screen_info, &tmp_x, &full_y, &tmp_w, &full_h); + break; + default: + clientMaxSpace (screen_info, &tmp_x, &full_y, &tmp_w, &full_h); + break; + } + + wc->x = tmp_x + frameLeft (c); + wc->width = tmp_w - frameLeft (c) - frameRight (c); + wc->y = tmp_y + frameTop (c); + wc->height = tmp_h - frameTop (c) - frameBottom (c); + return (wc->width <= c->size->max_width) && (wc->height <= c->size->max_height); + } + return TRUE; } *************** *** 3316,3321 **** --- 3360,3371 ---- case TILE_DOWN: mode = CLIENT_FLAG_MAXIMIZED_HORIZ; break; + case TILE_UP_LEFT: + case TILE_UP_RIGHT: + case TILE_DOWN_LEFT: + case TILE_DOWN_RIGHT: + mode = CLIENT_FLAG_TILED_CORNER; + break; default: return FALSE; break; diff -wcrBEb -x '*.o' -x xfwm4 -x '.*' -x 'Makefile*' -x '*icon*' -t '--tabsize=4' xfwm4/src/client.h xfce/xfwm4/src/client.h *** xfwm4/src/client.h 2013-01-08 19:12:13.427518928 +0100 --- xfce/xfwm4/src/client.h 2013-01-08 18:16:34.014441432 +0100 *************** *** 161,166 **** --- 161,167 ---- #define CLIENT_FLAG_DEMANDS_ATTENTION (1L<<17) #define CLIENT_FLAG_HAS_SHAPE (1L<<18) #define CLIENT_FLAG_FULLSCREN_MONITORS (1L<<19) + #define CLIENT_FLAG_TILED_CORNER (1L<<20) #define WM_FLAG_DELETE (1L<<0) #define WM_FLAG_INPUT (1L<<1) *************** *** 242,248 **** --- 243,253 ---- { TILE_NONE = 0, TILE_LEFT, + TILE_UP_LEFT, + TILE_DOWN_LEFT, TILE_RIGHT, + TILE_UP_RIGHT, + TILE_DOWN_RIGHT, TILE_DOWN, TILE_UP } diff -wcrBEb -x '*.o' -x xfwm4 -x '.*' -x 'Makefile*' -x '*icon*' -t '--tabsize=4' xfwm4/src/moveresize.c xfce/xfwm4/src/moveresize.c *** xfwm4/src/moveresize.c 2013-01-08 19:12:13.430518928 +0100 --- xfce/xfwm4/src/moveresize.c 2013-01-08 19:26:32.610538867 +0100 *************** *** 755,761 **** { ScreenInfo *screen_info; GdkRectangle rect; ! int x, y, disp_x, disp_y, disp_max_x, disp_max_y, dist; NetWmDesktopLayout layout; screen_info = c->screen_info; --- 755,761 ---- { ScreenInfo *screen_info; GdkRectangle rect; ! int x, y, x_disp, y_disp, disp_x, disp_y, disp_max_x, disp_max_y, disp_w, disp_h, dist; NetWmDesktopLayout layout; screen_info = c->screen_info; *************** *** 781,789 **** --- 781,817 ---- disp_max_x = rect.x + rect.width; disp_max_y = rect.y + rect.height; + disp_w = rect.width; + disp_h = rect.height; + x_disp = x-disp_x; + y_disp = y-disp_y; + layout = screen_info->desktop_layout; dist = MIN (TILE_DISTANCE, frameDecorationTop (screen_info) / 2); + if (!screen_info->params->wrap_windows || ((layout.cols < 2) && (layout.rows < 2)) ) + { + if ( (y_disp < dist && x_disp < disp_w/4) || (x_disp < dist && y_disp < disp_h/4)) + { + return clientTile (c, x, y, TILE_UP_LEFT, !screen_info->params->box_move); + } + + if ( (y_disp < dist && x_disp > 3*disp_w/4) || (x_disp > disp_w-dist && y_disp < disp_h/4)) + { + return clientTile (c, x, y, TILE_UP_RIGHT, !screen_info->params->box_move); + } + + if ( (y_disp > disp_h-dist && x_disp < disp_w/4) || (x_disp < dist && y_disp > 3*disp_h/4)) + { + return clientTile (c, x, y, TILE_DOWN_LEFT, !screen_info->params->box_move); + } + + if ( (y_disp > disp_h-dist && x_disp > 3*disp_w/4) || (x_disp > disp_w-dist && y_disp > 3*disp_h/4)) + { + return clientTile (c, x, y, TILE_DOWN_RIGHT, !screen_info->params->box_move); + } + } + if (!screen_info->params->wrap_windows || layout.cols < 2) { if ((x >= disp_x - 1) && (x < disp_x + dist) &&