mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
mouse: make float resize work better with sizehints
This commit is contained in:
parent
60591fe9bd
commit
41160e4cdf
1 changed files with 33 additions and 1 deletions
34
mouse.c
34
mouse.c
|
@ -646,8 +646,40 @@ mouse_client_resize_floating(client_t *c, corner_t corner, bool infobox)
|
|||
XCB_CURRENT_TIME, MOUSEMASK);
|
||||
}
|
||||
|
||||
if(globalconf.resize_hints && c->hassizehints)
|
||||
{
|
||||
int dx, dy;
|
||||
|
||||
/* apply size hints */
|
||||
geo = client_geometry_hints(c, geo);
|
||||
|
||||
/* get the nonmoveable corner back onto fixed_x,fixed_y */
|
||||
switch(corner)
|
||||
{
|
||||
default /* TopLeftCorner */:
|
||||
dx = fixed_x - AREA_RIGHT(geo);
|
||||
dy = fixed_y - AREA_BOTTOM(geo);
|
||||
break;
|
||||
case TopRightCorner:
|
||||
dx = fixed_x - AREA_LEFT(geo);
|
||||
dy = fixed_y - AREA_BOTTOM(geo);
|
||||
break;
|
||||
case BottomRightCorner:
|
||||
dx = fixed_x - AREA_LEFT(geo);
|
||||
dy = fixed_y - AREA_TOP(geo);
|
||||
break;
|
||||
case BottomLeftCorner:
|
||||
dx = fixed_x - AREA_RIGHT(geo);
|
||||
dy = fixed_y - AREA_TOP(geo);
|
||||
break;
|
||||
}
|
||||
|
||||
geo.x += dx;
|
||||
geo.y += dy;
|
||||
}
|
||||
|
||||
/* resize the client */
|
||||
client_resize(c, geo, true);
|
||||
client_resize(c, geo, false);
|
||||
|
||||
/* draw the infobox */
|
||||
if(sw)
|
||||
|
|
Loading…
Reference in a new issue