summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client.cc10
-rw-r--r--src/client.hh4
-rw-r--r--src/frame.cc8
3 files changed, 12 insertions, 10 deletions
diff --git a/src/client.cc b/src/client.cc
index f60a8da6..1b3ad1a9 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -495,7 +495,7 @@ void Client::updateNormalHints()
// changing its gravity
if (frame && _gravity != oldgravity) {
// move our idea of the client's position based on its new gravity
- int x, y;
+ int x = frame->rect().x(), y = frame->rect().y();
frame->frameGravity(x, y);
_area.setPos(x, y);
}
@@ -1146,9 +1146,11 @@ void Client::internal_resize(Corner anchor, int w, int h, bool user,
}
-void Client::move(int x, int y)
+void Client::move(int x, int y, bool framepos)
{
if (!(_functions & Func_Move)) return;
+ if (framepos)
+ frame->frameGravity(x, y);
internal_move(x, y);
}
@@ -1386,6 +1388,8 @@ void Client::maximize(bool max, int dir, bool savearea)
_gravity = StaticGravity;
// adjust our idea of position based on StaticGravity, so we stay put
// unless asked
+ x = frame->rect().x();
+ y = frame->rect().y();
frame->frameGravity(x, y);
if (savearea) {
@@ -1471,7 +1475,7 @@ void Client::maximize(bool max, int dir, bool savearea)
if (max) {
// because of my little gravity trick in here, we have to set the position
// of the client to what it really is
- int x, y;
+ int x = frame->rect().x(), y = frame->rect().y();
frame->frameGravity(x, y);
_area.setPos(x, y);
}
diff --git a/src/client.hh b/src/client.hh
index 02c12d43..6b44706e 100644
--- a/src/client.hh
+++ b/src/client.hh
@@ -621,8 +621,10 @@ BB @param window The window id that the Client class should handle
/*!
@param x The X coordinate to move to.
@param y The Y coordinate to move to.
+ @param bool framepos True if the frame should be moved to the position
+ instead of the client. This makes it ignore the gravity.
*/
- void move(int x, int y);
+ void move(int x, int y, bool framepos = false);
//! Resizes the client window, anchoring it in a given corner
/*!
diff --git a/src/frame.cc b/src/frame.cc
index 06b263d8..ab21daff 100644
--- a/src/frame.cc
+++ b/src/frame.cc
@@ -344,6 +344,8 @@ void Frame::adjustSize()
void Frame::adjustPosition()
{
int x, y;
+ x = _client->area().x();
+ y = _client->area().y();
clientGravity(x, y);
move(x, y);
}
@@ -450,9 +452,6 @@ void Frame::releaseClient()
void Frame::clientGravity(int &x, int &y)
{
- x = _client->area().x();
- y = _client->area().y();
-
// horizontal
switch (_client->gravity()) {
default:
@@ -509,9 +508,6 @@ void Frame::clientGravity(int &x, int &y)
void Frame::frameGravity(int &x, int &y)
{
- x = rect().x();
- y = rect().y();
-
// horizontal
switch (_client->gravity()) {
default: