| 30 | } |
| 31 | |
| 32 | bool 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 | |
| 59 | bool KWinControlUnitMgr::connected() const |
| 60 | { |