Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sokol_app] Status of clipboard support on X11? #995

Open
Dvad opened this issue Feb 22, 2024 · 2 comments
Open

[sokol_app] Status of clipboard support on X11? #995

Dvad opened this issue Feb 22, 2024 · 2 comments

Comments

@Dvad
Copy link

Dvad commented Feb 22, 2024

The X11 clipboard getter is left non implemented currently :

SOKOL_API_IMPL const char* sapp_get_clipboard_string(void) {
    if (!_sapp.clipboard.enabled) {
        return "";
    }
    #if defined(_SAPP_MACOS)
        return _sapp_macos_get_clipboard_string();
    #elif defined(_SAPP_EMSCRIPTEN)
        return _sapp.clipboard.buffer;
    #elif defined(_SAPP_WIN32)
        return _sapp_win32_get_clipboard_string();
    #else
        /* not implemented */
        return _sapp.clipboard.buffer;
    #endif
}

I wonder if there is a reason to that and if you would be open to have an implementation added. If so, I am happy to submit a PR.

Thank you for this really great library!

@floooh
Copy link
Owner

floooh commented Feb 22, 2024

Hmm, as far as I can see there's currently no clipboard support at all in the sokol_app.h X11 backend. I don't know how "terrible" an implementation via Xlib would be, but if you want to give it a shot and provide a PR I won't stop you ;) (a good starting point and inspiration would be GLFW).

@Dvad
Copy link
Author

Dvad commented Feb 22, 2024

I have a version of this function locally already, indeed inspired from glfw. I found X11 api is quite cryptic on the clipboard side so I am not super confident it is not terrible :). I will submit a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants