glfw icon indicating copy to clipboard operation
glfw copied to clipboard

Set MacOS Dock icon and query optimal icon size

Open ws909 opened this issue 1 year ago • 3 comments

Resolves #2041 Replaces #2244

The changes in this PR update glfwSetWindowIcon to allow a NULL window handle. When NULL is passed, GLFW sets the application's icon rather than a window's icon. An implementation for this is provided on MacOS.

This PR also updates glfwSetWindowIcon to allow querying for an optimal icon size. This requires an internal const-cast for the images parameter. This is unfortunate, but is required for backwards-compatibility. This preserves the signature of the function. This is currently only supported on MacOS.

Some platforms consume icons of more than one size at once. If GLFW is updated to return the optimal size for these platforms, the largest size should be returned. This is a limitation that is better revisited in GLFW 4.0.

This PR is more in line with #2286 and #2312, and should be the preferred choice over #2244.

Tested on MacOS with the icon and a new animate-icon test programs.

ws909 avatar Mar 09 '23 16:03 ws909