MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / connect

Method connect

source/MaaKWinControlUnit/Manager/KWinControlUnitMgr.cpp:32–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32bool KWinControlUnitMgr::connect()
33{
34 if (!input_) {
35 LogError << "input_ is nullptr";
36 return false;
37 }
38
39 LogFunc << VAR(device_node_) << VAR(screen_width_) << VAR(screen_height_);
40
41 // Open uinput input device
42 if (!input_->open(device_node_, screen_width_, screen_height_)) {
43 LogError << "Failed to open uinput device";
44 return false;
45 }
46
47 // NOTE: PipeWire screencap initialization is deferred to the first
48 // screencap() call (lazy initialization). We do NOT call open() here
49 // because:
50 // 1. D-Bus handshake (including the KDE auth dialog) should not be
51 // triggered during connect(), only when the user actually needs
52 // a screenshot.
53 // 2. PipeWire connection requires a file descriptor from the portal's
54 // OpenPipeWireRemote D-Bus method, which is only available after
55 // the portal Start call completes.
56 return true;
57}
58
59bool KWinControlUnitMgr::connected() const
60{

Callers

nothing calls this directly

Calls 1

openMethod · 0.45

Tested by

no test coverage detected