You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you call get_clipboard_string() while you clipboard is empty, on linux at least, you'll panic on
if (!*selectionString)
{
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
"X11: Failed to convert selection to string");
}
and one needs to provide error callback to avoid this. Meanwhile get_clipboard_string() returns Option<> so you expect it to just return None instead of panicking.
The text was updated successfully, but these errors were encountered:
I agree that it's a little surprising, but this is the expected outcome if you use glfw::init(glfw::FAIL_ON_ERRORS). Perhaps you could submit a GLFW issue to treat an empty clipboard differently from conversion error.
As you mentioned, providing a custom error callback could be used to ignore GLFW_FORMAT_UNAVAILABLE. It wouldn't hurt to add some documentation to this method to describe this edge case.
If you call get_clipboard_string() while you clipboard is empty, on linux at least, you'll panic on
and one needs to provide error callback to avoid this. Meanwhile get_clipboard_string() returns Option<> so you expect it to just return None instead of panicking.
The text was updated successfully, but these errors were encountered: