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
|
||||
void setSessionInteract(bool needed);
|
||||
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
|
||||
// Used by workspace
|
||||
|
|
|
@ -628,36 +628,47 @@ const char* Placement::policyToString(Policy policy)
|
|||
// 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.
|
||||
*/
|
||||
void Workspace::slotWindowPackLeft()
|
||||
{
|
||||
if (active_client && active_client->isMovable())
|
||||
active_client->move(packPositionLeft(active_client, active_client->geometry().left(), true),
|
||||
active_client->y());
|
||||
active_client->screen();
|
||||
active_client->packTo(packPositionLeft(active_client, active_client->geometry().left(), true),
|
||||
active_client->y());
|
||||
}
|
||||
|
||||
void Workspace::slotWindowPackRight()
|
||||
{
|
||||
if (active_client && active_client->isMovable())
|
||||
active_client->move(
|
||||
packPositionRight(active_client, active_client->geometry().right(), true)
|
||||
- active_client->width() + 1, active_client->y());
|
||||
active_client->packTo(packPositionRight(active_client, active_client->geometry().right(), true)
|
||||
- active_client->width() + 1, active_client->y());
|
||||
}
|
||||
|
||||
void Workspace::slotWindowPackUp()
|
||||
{
|
||||
if (active_client && active_client->isMovable())
|
||||
active_client->move(active_client->x(),
|
||||
packPositionUp(active_client, active_client->geometry().top(), true));
|
||||
active_client->packTo(active_client->x(),
|
||||
packPositionUp(active_client, active_client->geometry().top(), true));
|
||||
}
|
||||
|
||||
void Workspace::slotWindowPackDown()
|
||||
{
|
||||
if (active_client && active_client->isMovable())
|
||||
active_client->move(active_client->x(),
|
||||
packPositionDown(active_client, active_client->geometry().bottom(), true) - active_client->height() + 1);
|
||||
active_client->packTo(active_client->x(),
|
||||
packPositionDown(active_client, active_client->geometry().bottom(), true) - active_client->height() + 1);
|
||||
}
|
||||
|
||||
void Workspace::slotWindowGrowHorizontal()
|
||||
|
|
Loading…
Reference in a new issue