warp cursor per virtual desktop wrap direction
if there's no desktop toLeft/Right above/below it's wrong to warp the cursor, branch opens on corner edges CCBUG: 333341 Forward port of eea4bb81105f2c289831cf1f682c3927a24fd831 from kde-workspace
This commit is contained in:
parent
5d8ae96a56
commit
35bfec1511
1 changed files with 15 additions and 9 deletions
|
@ -255,24 +255,30 @@ void Edge::switchDesktop(const QPoint &cursorPos)
|
|||
{
|
||||
QPoint pos(cursorPos);
|
||||
VirtualDesktopManager *vds = VirtualDesktopManager::self();
|
||||
uint desktop = vds->current();
|
||||
const uint oldDesktop = vds->current();
|
||||
uint desktop = oldDesktop;
|
||||
const int OFFSET = 2;
|
||||
if (isLeft()) {
|
||||
const uint interimDesktop = desktop;
|
||||
desktop = vds->toLeft(desktop, vds->isNavigationWrappingAround());
|
||||
pos.setX(displayWidth() - 1 - OFFSET);
|
||||
}
|
||||
if (isRight()) {
|
||||
if (desktop != interimDesktop)
|
||||
pos.setX(displayWidth() - 1 - OFFSET);
|
||||
} else if (isRight()) {
|
||||
const uint interimDesktop = desktop;
|
||||
desktop = vds->toRight(desktop, vds->isNavigationWrappingAround());
|
||||
pos.setX(OFFSET);
|
||||
if (desktop != interimDesktop)
|
||||
pos.setX(OFFSET);
|
||||
}
|
||||
if (isTop()) {
|
||||
const uint interimDesktop = desktop;
|
||||
desktop = vds->above(desktop, vds->isNavigationWrappingAround());
|
||||
pos.setY(displayHeight() - 1 - OFFSET);
|
||||
}
|
||||
if (isBottom()) {
|
||||
if (desktop != interimDesktop)
|
||||
pos.setY(displayHeight() - 1 - OFFSET);
|
||||
} else if (isBottom()) {
|
||||
const uint interimDesktop = desktop;
|
||||
desktop = vds->below(desktop, vds->isNavigationWrappingAround());
|
||||
pos.setY(OFFSET);
|
||||
if (desktop != interimDesktop)
|
||||
pos.setY(OFFSET);
|
||||
}
|
||||
if (Client *c = Workspace::self()->getMovingClient()) {
|
||||
if (c->rules()->checkDesktop(desktop) != int(desktop)) {
|
||||
|
|
Loading…
Reference in a new issue