New paste Repaste Download
#include <hyprutils/os/FileDescriptor.hpp>
using namespace Hyprutils::OS;
CInputCaptureProtocol::CInputCaptureProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
    ;
@@ -47,26 +49,26 @@ void CInputCaptureProtocol::sendKeymap(SP<IKeyboard> keyboard, const UP<CHyprlan
        return;
    hyprlandInputCaptureManagerV1KeymapFormat format;
    CFileDescriptor                           fd;
    uint32_t                                  size;
    if (keyboard) {
        format = HYPRLAND_INPUT_CAPTURE_MANAGER_V1_KEYMAP_FORMAT_XKB_V1;
        fd     = keyboard->xkbKeymapFD.duplicate();
        size   = keyboard->xkbKeymapString.length() + 1;
    } else {
        format = HYPRLAND_INPUT_CAPTURE_MANAGER_V1_KEYMAP_FORMAT_NO_KEYMAP;
        fd     = CFileDescriptor{open("/dev/null", O_RDONLY | O_CLOEXEC)};
        if (!fd.isValid()) {
            LOGM(ERR, "Failed to open /dev/null");
            return;
        }
        size = 0;
    }
    manager->sendKeymap(format, fd.get(), size);
}
Filename: wat. Size: 1kb. View raw, , hex, or download this file.

This paste expires on 2025-03-02 08:30:00.062588. Pasted through v1-api.