constrain_window(struct ws_win *win, struct swm_region *r, int resizable)
{
if (win->g.x + win->g.w > r->g.x + r->g.w - border_width) {
constrain_window(struct ws_win *win, struct swm_region *r, int resizable)
{
if (win->g.x + win->g.w > r->g.x + r->g.w - border_width) {
win->g.w = r->g.x + r->g.w - win->g.x - border_width;
else
win->g.x = r->g.x + r->g.w - win->g.w - border_width;
}
win->g.w = r->g.x + r->g.w - win->g.x - border_width;
else
win->g.x = r->g.x + r->g.w - win->g.w - border_width;
}
shape = (left) ? XC_bottom_left_corner : XC_bottom_right_corner;
cursor = XCreateFontCursor(display, shape);
if (XGrabPointer(display, win->id, False, MOUSEMASK, GrabModeAsync,
GrabModeAsync, None, cursor, CurrentTime) != GrabSuccess) {
shape = (left) ? XC_bottom_left_corner : XC_bottom_right_corner;
cursor = XCreateFontCursor(display, shape);
if (XGrabPointer(display, win->id, False, MOUSEMASK, GrabModeAsync,
GrabModeAsync, None, cursor, CurrentTime) != GrabSuccess) {