mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 12:02:00 +00:00
Add window handle checks for glfwSetWindowIcon to Win32 and X11.
This commit is contained in:
parent
6381d7ed20
commit
6cd800a54d
@ -1521,6 +1521,14 @@ void _glfwSetWindowIconWin32(_GLFWwindow* window, int count, const GLFWimage* im
|
|||||||
{
|
{
|
||||||
HICON bigIcon = NULL, smallIcon = NULL;
|
HICON bigIcon = NULL, smallIcon = NULL;
|
||||||
|
|
||||||
|
if (window == NULL)
|
||||||
|
{
|
||||||
|
|
||||||
|
_glfwInputError(GLFW_FEATURE_UNAVAILABLE,
|
||||||
|
"Win32: Requires a valid window handle to set the icon. There is no application icon to set.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (count)
|
if (count)
|
||||||
{
|
{
|
||||||
const GLFWimage* bigImage = _glfwChooseImage(count, images,
|
const GLFWimage* bigImage = _glfwChooseImage(count, images,
|
||||||
|
@ -1899,7 +1899,7 @@ void _glfwSetWindowIconWayland(_GLFWwindow* window,
|
|||||||
int count, const GLFWimage* images)
|
int count, const GLFWimage* images)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_FEATURE_UNAVAILABLE,
|
_glfwInputError(GLFW_FEATURE_UNAVAILABLE,
|
||||||
"Wayland: The platform does not support setting the window icon");
|
"Wayland: The platform does not support setting the window or application icon");
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwGetWindowPosWayland(_GLFWwindow* window, int* xpos, int* ypos)
|
void _glfwGetWindowPosWayland(_GLFWwindow* window, int* xpos, int* ypos)
|
||||||
|
@ -2104,6 +2104,14 @@ void _glfwSetWindowTitleX11(_GLFWwindow* window, const char* title)
|
|||||||
|
|
||||||
void _glfwSetWindowIconX11(_GLFWwindow* window, int count, const GLFWimage* images)
|
void _glfwSetWindowIconX11(_GLFWwindow* window, int count, const GLFWimage* images)
|
||||||
{
|
{
|
||||||
|
if (window == NULL)
|
||||||
|
{
|
||||||
|
|
||||||
|
_glfwInputError(GLFW_FEATURE_UNAVAILABLE,
|
||||||
|
"X11: Requires a valid window handle to set the icon. There is no application icon to set.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (count)
|
if (count)
|
||||||
{
|
{
|
||||||
int longCount = 0;
|
int longCount = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user