MCPcopy Create free account
hub / github.com/KDE/kwin / startMouseInterception

Method startMouseInterception

src/effect/effecthandler.cpp:494–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492}
493
494void EffectsHandler::startMouseInterception(Effect *effect, Qt::CursorShape shape)
495{
496 if (m_grabbedMouseEffects.contains(effect)) {
497 return;
498 }
499 m_grabbedMouseEffects.append(effect);
500 if (m_grabbedMouseEffects.size() != 1) {
501 return;
502 }
503
504 input()->pointer()->setEffectsOverrideCursor(shape);
505
506 // We want to allow global shortcuts to be triggered when moving a
507 // window so it is possible to pick up a window and then move it to a
508 // different desktop by using the global shortcut to switch desktop.
509 // However, that means that some other things can also be triggered. If
510 // an effect that fill the screen gets triggered that way, we end up in a
511 // weird state where the move will restart after the effect closes. So to
512 // avoid that, abort move/resize if a full screen effect starts.
513 if (workspace()->moveResizeWindow()) {
514 workspace()->moveResizeWindow()->endInteractiveMoveResize();
515 }
516}
517
518void EffectsHandler::stopMouseInterception(Effect *effect)
519{

Callers 3

testEffectsMethod · 0.80
startInternalMethod · 0.80

Calls 9

inputFunction · 0.85
workspaceFunction · 0.85
appendMethod · 0.80
moveResizeWindowMethod · 0.80
containsMethod · 0.45
sizeMethod · 0.45
pointerMethod · 0.45

Tested by

no test coverage detected