diff --git a/client.c b/client.c index 5437a2a2..68a32387 100644 --- a/client.c +++ b/client.c @@ -372,7 +372,8 @@ client_manage(Window w, XWindowAttributes *wa, awesome_config *awesomeconf) } void -client_resize(Client *c, int x, int y, int w, int h, awesome_config *awesomeconf, Bool sizehints) +client_resize(Client *c, int x, int y, int w, int h, awesome_config *awesomeconf, + Bool sizehints, Bool volatile_coords) { double dx, dy, max, min, ratio; XWindowChanges wc; @@ -437,7 +438,9 @@ client_resize(Client *c, int x, int y, int w, int h, awesome_config *awesomeconf c->y = wc.y = y; c->w = wc.width = w; c->h = wc.height = h; - if(c->isfloating || get_current_layout(awesomeconf->tags, awesomeconf->ntags)->arrange == layout_floating) + if(!volatile_coords + && (c->isfloating + || get_current_layout(awesomeconf->tags, awesomeconf->ntags)->arrange == layout_floating)) { c->rx = c->x; c->ry = c->y; @@ -710,7 +713,7 @@ uicb_moveresize(awesome_config *awesomeconf, oh = sel->h; Bool xqp = XQueryPointer(awesomeconf->display, RootWindow(awesomeconf->display, awesomeconf->phys_screen), &dummy, &dummy, &mx, &my, &dx, &dy, &dui); - client_resize(sel, nx, ny, nw, nh, awesomeconf, True); + client_resize(sel, nx, ny, nw, nh, awesomeconf, True, False); if (xqp && ox <= mx && (ox + ow) >= mx && oy <= my && (oy + oh) >= my) { nmx = mx - ox + sel->w - ow - 1 < 0 ? 0 : mx - ox + sel->w - ow - 1; diff --git a/client.h b/client.h index 4032bd1a..9f72e4de 100644 --- a/client.h +++ b/client.h @@ -31,7 +31,7 @@ void client_reattach_after(Client *, Client *); void client_ban(Client *); void focus(Client *, Bool, awesome_config *); void client_manage(Window, XWindowAttributes *, awesome_config *); -void client_resize(Client *, int, int, int, int, awesome_config *, Bool); +void client_resize(Client *, int, int, int, int, awesome_config *, Bool, Bool); void client_unban(Client *); void client_unmanage(Client *, long, awesome_config *); inline void updatesizehints(Client *); diff --git a/config.mk b/config.mk index 7ce645ef..e9a2a602 100644 --- a/config.mk +++ b/config.mk @@ -18,7 +18,7 @@ INCS = -I. -I/usr/include -I${X11INC} `pkg-config --cflags libconfuse xft cairo` LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 `pkg-config --libs libconfuse xft cairo` -lXext -lXrandr -lXinerama # flags -CFLAGS = -fgnu89-inline -std=gnu99 -ggdb3 -pipe -Wall -Wextra -W -Wchar-subscripts -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wsign-compare -Wunused -Wuninitialized -Winit-self -Wpointer-arith -Wredundant-decls -Wno-format-zero-length -Wmissing-prototypes -Wmissing-format-attribute -Wmissing-noreturn -O3 ${INCS} -DVERSION=\"${VERSION}\" +CFLAGS = -fgnu89-inline -std=gnu99 -ggdb3 -pipe -Wall -Wextra -W -Wchar-subscripts -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wsign-compare -Wunused -Wuninitialized -Winit-self -Wpointer-arith -Wredundant-decls -Wno-format-zero-length -Wmissing-prototypes -Wmissing-format-attribute -Wmissing-noreturn -O0 ${INCS} -DVERSION=\"${VERSION}\" LDFLAGS = -ggdb3 ${LIBS} # compiler and linker diff --git a/event.c b/event.c index 1bd14abe..7f2b628b 100644 --- a/event.c +++ b/event.c @@ -86,7 +86,7 @@ movemouse(Client * c, awesome_config *awesomeconf) ny = si[c->screen].y_org; else if(abs((si[c->screen].y_org + si[c->screen].height) - (ny + c->h + 2 * c->border)) < awesomeconf[c->screen].snap) ny = si[c->screen].y_org + si[c->screen].height - c->h - 2 * c->border; - client_resize(c, nx, ny, c->w, c->h, &awesomeconf[c->screen], False); + client_resize(c, nx, ny, c->w, c->h, &awesomeconf[c->screen], False, False); break; } } @@ -131,7 +131,7 @@ resizemouse(Client * c, awesome_config *awesomeconf) nw = 1; if((nh = ev.xmotion.y - ocy - 2 * c->border + 1) <= 0) nh = 1; - client_resize(c, c->x, c->y, nw, nh, &awesomeconf[c->screen], True); + client_resize(c, c->x, c->y, nw, nh, &awesomeconf[c->screen], True, False); break; } } diff --git a/layout.c b/layout.c index a4910e5c..5fed912d 100644 --- a/layout.c +++ b/layout.c @@ -240,14 +240,10 @@ maximize(int x, int y, int w, int h, awesome_config *awesomeconf) { sel->wasfloating = sel->isfloating; sel->isfloating = True; - sel->rx = sel->x; - sel->ry = sel->y; - sel->rw = sel->w; - sel->rh = sel->h; - client_resize(sel, x, y, w, h, awesomeconf, True); + client_resize(sel, x, y, w, h, awesomeconf, True, True); } else if(sel->wasfloating) - client_resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, awesomeconf, True); + client_resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, awesomeconf, True, False); else sel->isfloating = False; diff --git a/layouts/floating.c b/layouts/floating.c index 293ce345..054629c5 100644 --- a/layouts/floating.c +++ b/layouts/floating.c @@ -29,6 +29,6 @@ layout_floating(awesome_config *awesomeconf) for(c = *awesomeconf->clients; c; c = c->next) if(isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags)) - client_resize(c, c->rx, c->ry, c->rw, c->rh, awesomeconf, True); + client_resize(c, c->rx, c->ry, c->rw, c->rh, awesomeconf, True, False); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/layouts/max.c b/layouts/max.c index f955160a..0abb001d 100644 --- a/layouts/max.c +++ b/layouts/max.c @@ -34,7 +34,7 @@ layout_max(awesome_config *awesomeconf) if(IS_TILED(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags)) client_resize(c, si[awesomeconf->screen].x_org, si[awesomeconf->screen].y_org, si[awesomeconf->screen].width - 2 * c->border, - si[awesomeconf->screen].height - 2 * c->border, awesomeconf, awesomeconf->resize_hints); + si[awesomeconf->screen].height - 2 * c->border, awesomeconf, awesomeconf->resize_hints, False); p_delete(&si); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 diff --git a/layouts/tile.c b/layouts/tile.c index 0e9ac450..24560777 100644 --- a/layouts/tile.c +++ b/layouts/tile.c @@ -138,7 +138,7 @@ _tile(awesome_config *awesomeconf, const Bool right) { /* master */ ny = way + i * mh; nx = wax + (right ? 0 : waw - mw); - client_resize(c, nx, ny, mw - 2 * c->border, mh - 2 * c->border, awesomeconf, awesomeconf->resize_hints); + client_resize(c, nx, ny, mw - 2 * c->border, mh - 2 * c->border, awesomeconf, awesomeconf->resize_hints, False); } else { /* tile window */ @@ -164,7 +164,7 @@ _tile(awesome_config *awesomeconf, const Bool right) ny = way + ((i - awesomeconf->nmaster) % win_by_col) * (nh + 2 * c->border); nx = wax + current_col * (nw + 2 * c->border) + (right ? mw : 0); - client_resize(c, nx, ny, nw, nh, awesomeconf, awesomeconf->resize_hints); + client_resize(c, nx, ny, nw, nh, awesomeconf, awesomeconf->resize_hints, False); } i++; } diff --git a/screen.c b/screen.c index 74080465..29bfef20 100644 --- a/screen.c +++ b/screen.c @@ -183,7 +183,7 @@ move_client_to_screen(Client *c, awesome_config *acf_new, Bool doresize) if(c->ry + c->rh >= si[c->screen].y_org + si[c->screen].height) c->ry = si[c->screen].y_org + si[c->screen].height - c->rh - 2 * c->border; - client_resize(c, c->rx, c->ry, c->rw, c->rh, acf_new, True); + client_resize(c, c->rx, c->ry, c->rw, c->rh, acf_new, True, False); p_delete(&si); p_delete(&si_old); diff --git a/tag.c b/tag.c index 8b8eb894..b2ee623a 100644 --- a/tag.c +++ b/tag.c @@ -177,7 +177,7 @@ uicb_togglefloating(awesome_config * awesomeconf, sel->isfloating = !sel->isfloating; - client_resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, awesomeconf, True); + client_resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, awesomeconf, True, False); client_untab(sel); saveprops(sel, awesomeconf->ntags);