validate screen and max'd state on packing windows
REVIEW: 110054 BUG: 304506 FIXED-IN: 4.11
This commit is contained in:
parent
7eaacfab18
commit
d2f9d8feee
2 changed files with 22 additions and 9 deletions
2
client.h
2
client.h
|
@ -638,6 +638,8 @@ public:
|
||||||
//sets whether the client should be treated as a SessionInteract window
|
//sets whether the client should be treated as a SessionInteract window
|
||||||
void setSessionInteract(bool needed);
|
void setSessionInteract(bool needed);
|
||||||
virtual bool isClient() const;
|
virtual bool isClient() const;
|
||||||
|
// a helper for the workspace window packing. tests for screen validity and updates since in maximization case as with normal moving
|
||||||
|
void packTo(int left, int top);
|
||||||
|
|
||||||
#ifdef KWIN_BUILD_KAPPMENU
|
#ifdef KWIN_BUILD_KAPPMENU
|
||||||
// Used by workspace
|
// Used by workspace
|
||||||
|
|
|
@ -628,35 +628,46 @@ const char* Placement::policyToString(Policy policy)
|
||||||
// Workspace
|
// Workspace
|
||||||
// ********************
|
// ********************
|
||||||
|
|
||||||
|
void Client::packTo(int left, int top)
|
||||||
|
{
|
||||||
|
const int oldScreen = screen();
|
||||||
|
move(left, top);
|
||||||
|
if (screen() != oldScreen) {
|
||||||
|
workspace()->sendClientToScreen(this, screen()); // checks rule validity
|
||||||
|
if (maximizeMode() != MaximizeRestore)
|
||||||
|
checkWorkspacePosition();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Moves active window left until in bumps into another window or workarea edge.
|
Moves active window left until in bumps into another window or workarea edge.
|
||||||
*/
|
*/
|
||||||
void Workspace::slotWindowPackLeft()
|
void Workspace::slotWindowPackLeft()
|
||||||
{
|
{
|
||||||
if (active_client && active_client->isMovable())
|
if (active_client && active_client->isMovable())
|
||||||
active_client->move(packPositionLeft(active_client, active_client->geometry().left(), true),
|
active_client->screen();
|
||||||
|
active_client->packTo(packPositionLeft(active_client, active_client->geometry().left(), true),
|
||||||
active_client->y());
|
active_client->y());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::slotWindowPackRight()
|
void Workspace::slotWindowPackRight()
|
||||||
{
|
{
|
||||||
if (active_client && active_client->isMovable())
|
if (active_client && active_client->isMovable())
|
||||||
active_client->move(
|
active_client->packTo(packPositionRight(active_client, active_client->geometry().right(), true)
|
||||||
packPositionRight(active_client, active_client->geometry().right(), true)
|
|
||||||
- active_client->width() + 1, active_client->y());
|
- active_client->width() + 1, active_client->y());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::slotWindowPackUp()
|
void Workspace::slotWindowPackUp()
|
||||||
{
|
{
|
||||||
if (active_client && active_client->isMovable())
|
if (active_client && active_client->isMovable())
|
||||||
active_client->move(active_client->x(),
|
active_client->packTo(active_client->x(),
|
||||||
packPositionUp(active_client, active_client->geometry().top(), true));
|
packPositionUp(active_client, active_client->geometry().top(), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::slotWindowPackDown()
|
void Workspace::slotWindowPackDown()
|
||||||
{
|
{
|
||||||
if (active_client && active_client->isMovable())
|
if (active_client && active_client->isMovable())
|
||||||
active_client->move(active_client->x(),
|
active_client->packTo(active_client->x(),
|
||||||
packPositionDown(active_client, active_client->geometry().bottom(), true) - active_client->height() + 1);
|
packPositionDown(active_client, active_client->geometry().bottom(), true) - active_client->height() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue