simplify client_resize
This commit is contained in:
parent
e833ab06d6
commit
a8a9b7d925
18
client.c
18
client.c
|
@ -439,7 +439,6 @@ client_resize(Client *c, int x, int y, int w, int h,
|
||||||
Bool sizehints, Bool volatile_coords)
|
Bool sizehints, Bool volatile_coords)
|
||||||
{
|
{
|
||||||
double dx, dy, max, min, ratio;
|
double dx, dy, max, min, ratio;
|
||||||
XWindowChanges wc;
|
|
||||||
Area area;
|
Area area;
|
||||||
Tag **curtags;
|
Tag **curtags;
|
||||||
|
|
||||||
|
@ -499,13 +498,12 @@ client_resize(Client *c, int x, int y, int w, int h,
|
||||||
y = 0;
|
y = 0;
|
||||||
if(c->x != x || c->y != y || c->w != w || c->h != h)
|
if(c->x != x || c->y != y || c->w != w || c->h != h)
|
||||||
{
|
{
|
||||||
c->x = wc.x = x;
|
c->x = x;
|
||||||
c->y = wc.y = y;
|
c->y = y;
|
||||||
c->w = wc.width = w;
|
c->w = w;
|
||||||
c->h = wc.height = h;
|
c->h = h;
|
||||||
curtags = get_current_tags(c->screen);
|
curtags = get_current_tags(c->screen);
|
||||||
if(!volatile_coords
|
if(!volatile_coords && (c->isfloating
|
||||||
&& (c->isfloating
|
|
||||||
|| curtags[0]->layout->arrange == layout_floating))
|
|| curtags[0]->layout->arrange == layout_floating))
|
||||||
{
|
{
|
||||||
c->rx = c->x;
|
c->rx = c->x;
|
||||||
|
@ -514,11 +512,9 @@ client_resize(Client *c, int x, int y, int w, int h,
|
||||||
c->rh = c->h;
|
c->rh = c->h;
|
||||||
}
|
}
|
||||||
p_delete(&curtags);
|
p_delete(&curtags);
|
||||||
wc.border_width = c->border;
|
XMoveResizeWindow(globalconf.display, c->win, c->x, c->y, c->w, c->h);
|
||||||
XConfigureWindow(globalconf.display, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc);
|
|
||||||
window_configure(c->win, c->x, c->y, c->w, c->h, c->border);
|
window_configure(c->win, c->x, c->y, c->w, c->h, c->border);
|
||||||
XSync(globalconf.display, False);
|
if(XineramaIsActive(globalconf.display))
|
||||||
if((c->x >= 0 || c->y >= 0) && XineramaIsActive(globalconf.display))
|
|
||||||
{
|
{
|
||||||
int new_screen = get_screen_bycoord(c->x, c->y);
|
int new_screen = get_screen_bycoord(c->x, c->y);
|
||||||
if(c->screen != new_screen)
|
if(c->screen != new_screen)
|
||||||
|
|
Loading…
Reference in New Issue