summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-08-25 11:26:15 +0000
committerDana Jansens <danakj@orodu.net>2002-08-25 11:26:15 +0000
commit328b861d19a9ff2612fd1ef6ddd40e5002343a80 (patch)
treeeaf1d0aed5a3411319a6ae5317fc9eaabb6afa44 /src
parente39c83774270d4c2b52b9c336dce66c08e919501 (diff)
use the window's gravity when handling a configureRequest event for a resize only
Diffstat (limited to 'src')
-rw-r--r--src/Window.cc43
1 files changed, 36 insertions, 7 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 350552ff..4b6aa493 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -2842,7 +2842,7 @@ void BlackboxWindow::configureRequestEvent(const XConfigureRequestEvent *cr) {
client.old_bw = cr->border_width;
if (cr->value_mask & (CWX | CWY | CWWidth | CWHeight)) {
- Rect req = frame.rect;
+ frame.changing = frame.rect;
if (cr->value_mask & (CWX | CWY)) {
if (cr->value_mask & CWX)
@@ -2850,16 +2850,45 @@ void BlackboxWindow::configureRequestEvent(const XConfigureRequestEvent *cr) {
if (cr->value_mask & CWY)
client.rect.setY(cr->y);
- applyGravity(req);
+ applyGravity(frame.changing);
}
- if (cr->value_mask & CWWidth)
- req.setWidth(cr->width + frame.margin.left + frame.margin.right);
+ if (cr->value_mask & (CWWidth | CWHeight)) {
+ if (cr->value_mask & CWWidth)
+ frame.changing.setWidth(cr->width +
+ frame.margin.left + frame.margin.right);
+
+ if (cr->value_mask & CWHeight)
+ frame.changing.setHeight(cr->height +
+ frame.margin.top + frame.margin.bottom);
- if (cr->value_mask & CWHeight)
- req.setHeight(cr->height + frame.margin.top + frame.margin.bottom);
+ /*
+ if a position change ha been specified, then that position will be used
+ instead of determining a position based on the window's gravity.
+ */
+ if (cr->value_mask & (CWX | CWY)) {
+ Corner corner;
+ switch (client.win_gravity) {
+ case NorthEastGravity:
+ case EastGravity:
+ corner = TopRight;
+ break;
+ case SouthWestGravity:
+ case SouthGravity:
+ corner = BottomLeft;
+ break;
+ case SouthEastGravity:
+ corner = BottomRight;
+ break;
+ default: // NorthWest, Static, etc
+ corner = TopLeft;
+ }
+ constrain(corner);
+ }
+ }
- configure(req.x(), req.y(), req.width(), req.height());
+ configure(frame.changing.x(), frame.changing.y(),
+ frame.changing.width(), frame.changing.height());
}
if (cr->value_mask & CWStackMode && !isDesktop()) {