diff -cr xfwm4-4.12.3/src/display.c xfwm4-4.12.3.patched/src/display.c *** xfwm4-4.12.3/src/display.c 2015-05-15 14:25:56.000000000 +0200 --- xfwm4-4.12.3.patched/src/display.c 2015-09-05 17:56:45.639963375 +0200 *************** *** 406,411 **** --- 406,413 ---- XCreateFontCursor (display->dpy, XC_top_side); display->resize_cursor[CORNER_COUNT + SIDE_BOTTOM] = XCreateFontCursor (display->dpy, XC_bottom_side); + display->resize_cursor[CORNER_COUNT + RESIZE_GESTURE] = + XCreateFontCursor (display->dpy, XC_crosshair); } void *************** *** 455,461 **** myDisplayGetCursorResize (DisplayInfo *display, guint list) { g_return_val_if_fail (display, None); ! g_return_val_if_fail (list < 8, None); return display->resize_cursor [list]; } --- 457,463 ---- myDisplayGetCursorResize (DisplayInfo *display, guint list) { g_return_val_if_fail (display, None); ! g_return_val_if_fail (list <= HANDLES_COUNT, None); return display->resize_cursor [list]; } diff -cr xfwm4-4.12.3/src/display.h xfwm4-4.12.3.patched/src/display.h *** xfwm4-4.12.3/src/display.h 2015-05-16 18:41:45.000000000 +0200 --- xfwm4-4.12.3.patched/src/display.h 2015-09-05 17:56:45.639963375 +0200 *************** *** 111,116 **** --- 111,117 ---- SIDE_RIGHT, SIDE_TOP, SIDE_BOTTOM, + RESIZE_GESTURE, SIDE_COUNT }; #define NO_HANDLE -1 diff -cr xfwm4-4.12.3/src/events.c xfwm4-4.12.3.patched/src/events.c *** xfwm4-4.12.3/src/events.c 2015-05-15 14:25:56.000000000 +0200 --- xfwm4-4.12.3.patched/src/events.c 2015-09-05 17:56:45.643296708 +0200 *************** *** 791,800 **** { XfwmButtonClickType tclick; tclick = typeOfClick (screen_info, c->window, (XEvent *) ev, FALSE); if (tclick == XFWM_BUTTON_DRAG) { ! clientMove (c, (XEvent *) ev); } else if (tclick != XFWM_BUTTON_UNDEFINED) { --- 791,806 ---- { XfwmButtonClickType tclick; + if (!(c->type & WINDOW_TYPE_DONT_FOCUS)) + { + clientSetFocus (screen_info, c, ev->time, NO_FOCUS_FLAG); + } + clientRaise (c, None); + tclick = typeOfClick (screen_info, c->window, (XEvent *) ev, FALSE); if (tclick == XFWM_BUTTON_DRAG) { ! clientResize (c, CORNER_COUNT + RESIZE_GESTURE, (XEvent *) ev); } else if (tclick != XFWM_BUTTON_UNDEFINED) { diff -cr xfwm4-4.12.3/src/moveresize.c xfwm4-4.12.3.patched/src/moveresize.c *** xfwm4-4.12.3/src/moveresize.c 2015-05-15 14:25:56.000000000 +0200 --- xfwm4-4.12.3.patched/src/moveresize.c 2015-09-05 18:06:18.799944430 +0200 *************** *** 73,78 **** --- 73,79 ---- gboolean is_transient; gboolean move_resized; gboolean released; + gboolean resize_gesture; guint button; gint cancel_x, cancel_y; gint cancel_w, cancel_h; *************** *** 1379,1384 **** --- 1380,1387 ---- gboolean resizing; int right_edge; /* -Cliff */ int bottom_edge; /* -Cliff */ + gboolean newcursor; + Cursor cursor; TRACE ("entering clientResizeEventFilter"); *************** *** 1393,1398 **** --- 1396,1402 ---- * we use XFWM_FLAG_MOVING_RESIZING for that. */ resizing = FLAG_TEST (c->xfwm_flags, XFWM_FLAG_MOVING_RESIZING); + newcursor = FALSE; cx = frameExtentX (c) + (frameExtentWidth (c) / 2); cy = frameExtentY (c) + (frameExtentHeight (c) / 2); *************** *** 1556,1561 **** --- 1560,1595 ---- right_edge = c->x + c->width; bottom_edge = c->y + c->height; + if (!move_left && !move_right && passdata->resize_gesture) + { + if (xevent->xmotion.x_root >= c->x + c->width + frameExtentRight (c) - 1) + { + move_right = 1; + switch (passdata->handle) + { + case CORNER_COUNT + SIDE_TOP: passdata->handle = CORNER_TOP_RIGHT; break; + case CORNER_COUNT + SIDE_BOTTOM: passdata->handle = CORNER_BOTTOM_RIGHT; break; + case CORNER_COUNT + RESIZE_GESTURE: passdata->handle = CORNER_COUNT + SIDE_RIGHT; break; + } + newcursor = TRUE; + passdata->ow = c->width; + passdata->mx = c->x + c->width + frameExtentRight (c) - 1; + } + else if (xevent->xmotion.x_root <= c->x - frameExtentLeft(c)) + { + move_left = 1; + switch (passdata->handle) + { + case CORNER_COUNT + SIDE_TOP: passdata->handle = CORNER_TOP_LEFT; break; + case CORNER_COUNT + SIDE_BOTTOM: passdata->handle = CORNER_BOTTOM_LEFT; break; + case CORNER_COUNT + RESIZE_GESTURE: passdata->handle = CORNER_COUNT + SIDE_LEFT; break; + } + newcursor = TRUE; + passdata->ow = c->width; + passdata->mx = passdata->ox - frameExtentLeft(c); + } + } + if (move_left) { c->width = passdata->ow - (xevent->xmotion.x_root - passdata->mx); *************** *** 1575,1580 **** --- 1609,1644 ---- } if (!FLAG_TEST (c->flags, CLIENT_FLAG_SHADED)) { + if (!move_top && !move_bottom && passdata->resize_gesture) + { + if (xevent->xmotion.y_root <= c->y - frameExtentTop(c)) + { + move_top = 1; + switch (passdata->handle) + { + case CORNER_COUNT + SIDE_LEFT: passdata->handle = CORNER_TOP_LEFT; break; + case CORNER_COUNT + SIDE_RIGHT: passdata->handle = CORNER_TOP_RIGHT; break; + case CORNER_COUNT + RESIZE_GESTURE: passdata->handle = CORNER_COUNT + SIDE_TOP; break; + } + newcursor = TRUE; + passdata->oh = c->height; + passdata->my = passdata->oy - frameExtentTop(c); + } + else if (xevent->xmotion.y_root >= c->y + c->height + frameExtentBottom (c) - 1) + { + move_bottom = 1; + switch (passdata->handle) + { + case CORNER_COUNT + SIDE_LEFT: passdata->handle = CORNER_BOTTOM_LEFT; break; + case CORNER_COUNT + SIDE_RIGHT: passdata->handle = CORNER_BOTTOM_RIGHT; break; + case CORNER_COUNT + RESIZE_GESTURE: passdata->handle = CORNER_COUNT + SIDE_BOTTOM; break; + } + newcursor = TRUE; + passdata->oh = c->height; + passdata->my = c->y + c->height + frameExtentBottom (c) - 1; + } + } + if (move_top) { c->height = passdata->oh - (xevent->xmotion.y_root - passdata->my); *************** *** 1601,1607 **** c->width -= c->x - cx; /* Apply contrain ratio if any, only once the expected size is set */ ! clientConstrainRatio (c, passdata->handle); c->width = clientCheckWidth (c, c->width, FALSE); if (move_left) --- 1665,1671 ---- c->width -= c->x - cx; /* Apply contrain ratio if any, only once the expected size is set */ ! if (passdata->handle != CORNER_COUNT + RESIZE_GESTURE) clientConstrainRatio (c, passdata->handle); c->width = clientCheckWidth (c, c->width, FALSE); if (move_left) *************** *** 1615,1620 **** --- 1679,1689 ---- c->y = bottom_edge - c->height; } + if (newcursor) + { + cursor = myDisplayGetCursorResize (display_info, passdata->handle); + myScreenChangeGrabPointer (screen_info, MOVERESIZE_EVENT_MASK, cursor, myDisplayGetCurrentTime (display_info)); + } if (passdata->poswin) { poswinSetPosition (passdata->poswin, c); *************** *** 1715,1720 **** --- 1784,1790 ---- passdata.use_keys = FALSE; passdata.grab = FALSE; passdata.released = FALSE; + passdata.resize_gesture = (handle == CORNER_COUNT + RESIZE_GESTURE); passdata.button = 0; passdata.handle = handle; passdata.wireframe = NULL;