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

Method grab

src/scripting/scriptedeffect.cpp:596–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

594}
595
596bool ScriptedEffect::grab(EffectWindow *w, DataRole grabRole, bool force)
597{
598 void *grabber = w->data(grabRole).value<void *>();
599
600 if (grabber == this) {
601 return true;
602 }
603
604 if (grabber != nullptr && grabber != this && !force) {
605 return false;
606 }
607
608 w->setData(grabRole, QVariant::fromValue(static_cast<void *>(this)));
609
610 return true;
611}
612
613bool ScriptedEffect::ungrab(EffectWindow *w, DataRole grabRole)
614{

Callers 2

main.jsFile · 0.45
main.jsFile · 0.45

Calls 2

dataMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected