diff --git a/src/servers/app/Layer.cpp b/src/servers/app/Layer.cpp index 0decfe844f..294fa45459 100644 --- a/src/servers/app/Layer.cpp +++ b/src/servers/app/Layer.cpp @@ -978,7 +978,7 @@ Layer::ResizeBy(float x, float y) if(!fParent) { - printf("ERROR: in Layer::MoveBy()! - No parent!\n"); + printf("ERROR: in Layer::ResizeBy()! - No parent!\n"); return; } diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index d27779b45a..be3f481228 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -706,8 +706,11 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link) link.Read(&x); link.Read(&y); - - cl->MoveBy(x, y); + + float offsetX = x - cl->fFrame.left; + float offsetY = y - cl->fFrame.top; + + cl->MoveBy(offsetX, offsetY); break; } @@ -719,9 +722,12 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link) link.Read(&newWidth); link.Read(&newHeight); - // TODO: Check for minimum size allowed. Need WinBorder::GetSizeLimits - - cl->ResizeBy(newWidth, newHeight); + // TODO: If cl is a window, check for minimum size allowed. + // Need WinBorder::GetSizeLimits + float deltaWidth = newWidth - cl->fFrame.Width(); + float deltaHeight = newHeight - cl->fFrame.Height(); + + cl->ResizeBy(deltaWidth, deltaHeight); break; }