diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index ca8796b2..dac116b7 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -3395,6 +3395,9 @@ GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* i */ GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* window, int progressState, double value); +//Use count = GLFW_DONT_CARE to disable overlay/badge icon +GLFWAPI void glfwSetWindowTaskbarBadge(GLFWwindow* window, int count); + /*! @brief Retrieves the position of the content area of the specified window. * * This function retrieves the position, in screen coordinates, of the diff --git a/src/cocoa_init.m b/src/cocoa_init.m index 5d199170..1c82f3ce 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -529,6 +529,7 @@ GLFWbool _glfwConnectCocoa(int platformID, _GLFWplatform* platform) _glfwSetWindowTitleCocoa, _glfwSetWindowIconCocoa, _glfwSetWindowTaskbarProgressCocoa, + _glfwSetWindowTaskbarBadgeCocoa, _glfwGetWindowPosCocoa, _glfwSetWindowPosCocoa, _glfwGetWindowSizeCocoa, diff --git a/src/cocoa_platform.h b/src/cocoa_platform.h index aeda201b..3ec55489 100644 --- a/src/cocoa_platform.h +++ b/src/cocoa_platform.h @@ -231,6 +231,7 @@ void _glfwDestroyWindowCocoa(_GLFWwindow* window); void _glfwSetWindowTitleCocoa(_GLFWwindow* window, const char* title); void _glfwSetWindowIconCocoa(_GLFWwindow* window, int count, const GLFWimage* images); void _glfwSetWindowTaskbarProgressCocoa(_GLFWwindow* window, int progressState, double value); +void _glfwSetWindowTaskbarBadgeCocoa(_GLFWwindow* window, int count); void _glfwGetWindowPosCocoa(_GLFWwindow* window, int* xpos, int* ypos); void _glfwSetWindowPosCocoa(_GLFWwindow* window, int xpos, int ypos); void _glfwGetWindowSizeCocoa(_GLFWwindow* window, int* width, int* height); diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 7ec251e0..7f7c8bf1 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -1167,6 +1167,10 @@ void _glfwSetWindowTaskbarProgressCocoa(_GLFWwindow* window, int progressState, window->ns.dockProgressIndicator.value = value; } +void _glfwSetWindowTaskbarBadgeCocoa(_GLFWwindow* window, int count) +{ +} + void _glfwGetWindowPosCocoa(_GLFWwindow* window, int* xpos, int* ypos) { @autoreleasepool { diff --git a/src/internal.h b/src/internal.h index 3766294b..5c7e3e5e 100644 --- a/src/internal.h +++ b/src/internal.h @@ -707,6 +707,7 @@ struct _GLFWplatform void (*setWindowTitle)(_GLFWwindow*,const char*); void (*setWindowIcon)(_GLFWwindow*,int,const GLFWimage*); void (*setWindowTaskbarProgress)(_GLFWwindow*,const int,double); + void (*setWindowTaskbarBadge)(_GLFWwindow*,int); void (*getWindowPos)(_GLFWwindow*,int*,int*); void (*setWindowPos)(_GLFWwindow*,int,int); void (*getWindowSize)(_GLFWwindow*,int*,int*); diff --git a/src/null_init.c b/src/null_init.c index d3d8c8cb..cef34bcd 100644 --- a/src/null_init.c +++ b/src/null_init.c @@ -74,6 +74,7 @@ GLFWbool _glfwConnectNull(int platformID, _GLFWplatform* platform) _glfwSetWindowTitleNull, _glfwSetWindowIconNull, _glfwSetWindowTaskbarProgressNull, + _glfwSetWindowTaskbarBadgeNull, _glfwGetWindowPosNull, _glfwSetWindowPosNull, _glfwGetWindowSizeNull, diff --git a/src/null_platform.h b/src/null_platform.h index c430eb37..529ae48d 100644 --- a/src/null_platform.h +++ b/src/null_platform.h @@ -90,6 +90,7 @@ void _glfwDestroyWindowNull(_GLFWwindow* window); void _glfwSetWindowTitleNull(_GLFWwindow* window, const char* title); void _glfwSetWindowIconNull(_GLFWwindow* window, int count, const GLFWimage* images); void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, int progressState, double value); +void _glfwSetWindowTaskbarBadgeNull(_GLFWwindow* window, int count); void _glfwSetWindowMonitorNull(_GLFWwindow* window, _GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate); void _glfwGetWindowPosNull(_GLFWwindow* window, int* xpos, int* ypos); void _glfwSetWindowPosNull(_GLFWwindow* window, int xpos, int ypos); diff --git a/src/null_window.c b/src/null_window.c index 812c7ab3..97cd92cc 100644 --- a/src/null_window.c +++ b/src/null_window.c @@ -191,6 +191,10 @@ void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, int progressState, d { } +void _glfwSetWindowTaskbarBadgeNull(_GLFWwindow* window, int count) +{ +} + void _glfwSetWindowMonitorNull(_GLFWwindow* window, _GLFWmonitor* monitor, int xpos, int ypos, diff --git a/src/win32_init.c b/src/win32_init.c index 8c097b10..a3dc0168 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -639,6 +639,7 @@ GLFWbool _glfwConnectWin32(int platformID, _GLFWplatform* platform) _glfwSetWindowTitleWin32, _glfwSetWindowIconWin32, _glfwSetWindowTaskbarProgressWin32, + _glfwSetWindowTaskbarBadgeWin32, _glfwGetWindowPosWin32, _glfwSetWindowPosWin32, _glfwGetWindowSizeWin32, diff --git a/src/win32_platform.h b/src/win32_platform.h index f78a4861..30c943f8 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -619,6 +619,7 @@ void _glfwDestroyWindowWin32(_GLFWwindow* window); void _glfwSetWindowTitleWin32(_GLFWwindow* window, const char* title); void _glfwSetWindowIconWin32(_GLFWwindow* window, int count, const GLFWimage* images); void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, int progressState, double value); +void _glfwSetWindowTaskbarBadgeWin32(_GLFWwindow* window, int count); void _glfwGetWindowPosWin32(_GLFWwindow* window, int* xpos, int* ypos); void _glfwSetWindowPosWin32(_GLFWwindow* window, int xpos, int ypos); void _glfwGetWindowSizeWin32(_GLFWwindow* window, int* width, int* height); diff --git a/src/win32_window.c b/src/win32_window.c index 96278971..09c12537 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1643,6 +1643,11 @@ void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, int progressState, _glfwInputErrorWin32(GLFW_PLATFORM_ERROR, "Win32: Failed to set taskbar progress state"); } +void _glfwSetWindowTaskbarBadgeWin32(_GLFWwindow* window, int count) +{ + //TODO +} + void _glfwGetWindowPosWin32(_GLFWwindow* window, int* xpos, int* ypos) { POINT pos = { 0, 0 }; diff --git a/src/window.c b/src/window.c index c7aca29d..d7d2b2b5 100644 --- a/src/window.c +++ b/src/window.c @@ -583,6 +583,23 @@ GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* handle, int progressState, _glfw.platform.setWindowTaskbarProgress(window, progressState, value); } +GLFWAPI void glfwSetWindowTaskbarBadge(GLFWwindow* handle, int count) +{ + _GLFWwindow* window = (_GLFWwindow*)handle; + + assert(window != NULL); + + _GLFW_REQUIRE_INIT(); + + if (count != GLFW_DONT_CARE && (count < 0 || count > 99)) + { + _glfwInputError(GLFW_INVALID_VALUE, "Invalid badge count %d", count); + return; + } + + _glfw.platform.setWindowTaskbarBadge(window, count); +} + GLFWAPI void glfwGetWindowPos(GLFWwindow* handle, int* xpos, int* ypos) { _GLFWwindow* window = (_GLFWwindow*) handle; diff --git a/src/wl_init.c b/src/wl_init.c index 4687b0e8..985a42a0 100644 --- a/src/wl_init.c +++ b/src/wl_init.c @@ -420,6 +420,7 @@ GLFWbool _glfwConnectWayland(int platformID, _GLFWplatform* platform) _glfwSetWindowTitleWayland, _glfwSetWindowIconWayland, _glfwSetWindowTaskbarProgressWayland, + _glfwSetWindowTaskbarBadgeWayland, _glfwGetWindowPosWayland, _glfwSetWindowPosWayland, _glfwGetWindowSizeWayland, diff --git a/src/wl_platform.h b/src/wl_platform.h index 918f232d..49cb36e0 100644 --- a/src/wl_platform.h +++ b/src/wl_platform.h @@ -447,6 +447,7 @@ void _glfwDestroyWindowWayland(_GLFWwindow* window); void _glfwSetWindowTitleWayland(_GLFWwindow* window, const char* title); void _glfwSetWindowIconWayland(_GLFWwindow* window, int count, const GLFWimage* images); void _glfwSetWindowTaskbarProgressWayland(_GLFWwindow* window, int progressState, double value); +void _glfwSetWindowTaskbarBadgeWayland(_GLFWwindow* window, int count); void _glfwGetWindowPosWayland(_GLFWwindow* window, int* xpos, int* ypos); void _glfwSetWindowPosWayland(_GLFWwindow* window, int xpos, int ypos); void _glfwGetWindowSizeWayland(_GLFWwindow* window, int* width, int* height); diff --git a/src/wl_window.c b/src/wl_window.c index a4460e93..2917e226 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1911,6 +1911,10 @@ void _glfwSetWindowTaskbarProgressWayland(_GLFWwindow* window, const int progres _glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, value); } +void _glfwSetWindowTaskbarBadgeWayland(_GLFWwindow* window, int count) +{ +} + void _glfwGetWindowPosWayland(_GLFWwindow* window, int* xpos, int* ypos) { // A Wayland client is not aware of its position, so just warn and leave it diff --git a/src/x11_init.c b/src/x11_init.c index 3a5c71bf..66c9d54c 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -1210,6 +1210,7 @@ GLFWbool _glfwConnectX11(int platformID, _GLFWplatform* platform) _glfwSetWindowTitleX11, _glfwSetWindowIconX11, _glfwSetWindowTaskbarProgressX11, + _glfwSetWindowTaskbarBadgeX11, _glfwGetWindowPosX11, _glfwSetWindowPosX11, _glfwGetWindowSizeX11, diff --git a/src/x11_platform.h b/src/x11_platform.h index 96280653..7c17ed08 100644 --- a/src/x11_platform.h +++ b/src/x11_platform.h @@ -906,6 +906,7 @@ void _glfwDestroyWindowX11(_GLFWwindow* window); void _glfwSetWindowTitleX11(_GLFWwindow* window, const char* title); void _glfwSetWindowIconX11(_GLFWwindow* window, int count, const GLFWimage* images); void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, int progressState, double value); +void _glfwSetWindowTaskbarBadgeX11(_GLFWwindow* window, int count); void _glfwGetWindowPosX11(_GLFWwindow* window, int* xpos, int* ypos); void _glfwSetWindowPosX11(_GLFWwindow* window, int xpos, int ypos); void _glfwGetWindowSizeX11(_GLFWwindow* window, int* width, int* height); diff --git a/src/x11_window.c b/src/x11_window.c index 6c2297ef..d7001b56 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -2161,6 +2161,10 @@ void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, int progressState, do _glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, value); } +void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, int count) +{ +} + void _glfwGetWindowPosX11(_GLFWwindow* window, int* xpos, int* ypos) { Window dummy;