Changeset View
Changeset View
Standalone View
Standalone View
screenedge.cpp
Show First 20 Lines • Show All 177 Lines • ▼ Show 20 Line(s) | |||||
178 | { | 178 | { | ||
179 | if (m_client) { | 179 | if (m_client) { | ||
180 | return true; | 180 | return true; | ||
181 | } | 181 | } | ||
182 | if (m_edges->isDesktopSwitching()) { | 182 | if (m_edges->isDesktopSwitching()) { | ||
183 | return true; | 183 | return true; | ||
184 | } | 184 | } | ||
185 | if (m_edges->isDesktopSwitchingMovingClients()) { | 185 | if (m_edges->isDesktopSwitchingMovingClients()) { | ||
186 | auto c = Workspace::self()->getMovingClient(); | 186 | auto c = Workspace::self()->moveResizeClient(); | ||
187 | if (c && !c->isResize()) { | 187 | if (c && !c->isResize()) { | ||
188 | return true; | 188 | return true; | ||
189 | } | 189 | } | ||
190 | } | 190 | } | ||
191 | if (!m_callBacks.isEmpty()) { | 191 | if (!m_callBacks.isEmpty()) { | ||
192 | return true; | 192 | return true; | ||
193 | } | 193 | } | ||
194 | if (m_action != ElectricActionNone) { | 194 | if (m_action != ElectricActionNone) { | ||
▲ Show 20 Lines • Show All 97 Lines • ▼ Show 20 Line(s) | 276 | { | |||
292 | if ((cursorPos - m_triggeredPoint).manhattanLength() > DISTANCE_RESET) { | 292 | if ((cursorPos - m_triggeredPoint).manhattanLength() > DISTANCE_RESET) { | ||
293 | return false; | 293 | return false; | ||
294 | } | 294 | } | ||
295 | return true; | 295 | return true; | ||
296 | } | 296 | } | ||
297 | 297 | | |||
298 | void Edge::handle(const QPoint &cursorPos) | 298 | void Edge::handle(const QPoint &cursorPos) | ||
299 | { | 299 | { | ||
300 | AbstractClient *movingClient = Workspace::self()->getMovingClient(); | 300 | AbstractClient *movingClient = Workspace::self()->moveResizeClient(); | ||
301 | if ((edges()->isDesktopSwitchingMovingClients() && movingClient && !movingClient->isResize()) || | 301 | if ((edges()->isDesktopSwitchingMovingClients() && movingClient && !movingClient->isResize()) || | ||
302 | (edges()->isDesktopSwitching() && isScreenEdge())) { | 302 | (edges()->isDesktopSwitching() && isScreenEdge())) { | ||
303 | // always switch desktops in case: | 303 | // always switch desktops in case: | ||
304 | // moving a Client and option for switch on client move is enabled | 304 | // moving a Client and option for switch on client move is enabled | ||
305 | // or switch on screen edge is enabled | 305 | // or switch on screen edge is enabled | ||
306 | switchDesktop(cursorPos); | 306 | switchDesktop(cursorPos); | ||
307 | return; | 307 | return; | ||
308 | } | 308 | } | ||
▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Line(s) | 430 | if (desktop != interimDesktop) | |||
431 | pos.setY(screens()->size().height() - 1 - OFFSET); | 431 | pos.setY(screens()->size().height() - 1 - OFFSET); | ||
432 | } else if (isBottom()) { | 432 | } else if (isBottom()) { | ||
433 | const uint interimDesktop = desktop; | 433 | const uint interimDesktop = desktop; | ||
434 | desktop = vds->below(desktop, vds->isNavigationWrappingAround()); | 434 | desktop = vds->below(desktop, vds->isNavigationWrappingAround()); | ||
435 | if (desktop != interimDesktop) | 435 | if (desktop != interimDesktop) | ||
436 | pos.setY(OFFSET); | 436 | pos.setY(OFFSET); | ||
437 | } | 437 | } | ||
438 | #ifndef KWIN_UNIT_TEST | 438 | #ifndef KWIN_UNIT_TEST | ||
439 | if (AbstractClient *c = Workspace::self()->getMovingClient()) { | 439 | if (AbstractClient *c = Workspace::self()->moveResizeClient()) { | ||
440 | if (c->rules()->checkDesktop(desktop) != int(desktop)) { | 440 | if (c->rules()->checkDesktop(desktop) != int(desktop)) { | ||
441 | // user attempts to move a client to another desktop where it is ruleforced to not be | 441 | // user attempts to move a client to another desktop where it is ruleforced to not be | ||
442 | return; | 442 | return; | ||
443 | } | 443 | } | ||
444 | } | 444 | } | ||
445 | #endif | 445 | #endif | ||
446 | vds->setCurrent(desktop); | 446 | vds->setCurrent(desktop); | ||
447 | if (vds->current() != oldDesktop) { | 447 | if (vds->current() != oldDesktop) { | ||
▲ Show 20 Lines • Show All 1047 Lines • Show Last 20 Lines |