diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index 8854af9c..3b622d35 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -3365,7 +3365,7 @@ GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* i * @ref GLFW_TASKBAR_PROGRESS_DISABLED, @ref GLFW_TASKBAR_PROGRESS_INDETERMINATE, * @ref GLFW_TASKBAR_PROGRESS_NORMAL, @ref GLFW_TASKBAR_PROGRESS_ERROR * and @ref GLFW_TASKBAR_PROGRESS_PAUSED. - * @param[in] completed The amount of completed progress to set. Valid range is 0 to 100. + * @param[in] value The amount of completed progress to set. Valid range is 0 to 100. * This is ignored if progressState is set to @ref GLFW_TASKBAR_PROGRESS_DISABLED. * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref @@ -3391,7 +3391,7 @@ GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* i * * @ingroup window */ -GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* window, const int progressState, int completed); +GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* window, const int progressState, int value); /*! @brief Retrieves the position of the content area of the specified window. * @@ -6510,3 +6510,4 @@ GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window #endif #endif /* _glfw3_h_ */ + diff --git a/src/cocoa_platform.h b/src/cocoa_platform.h index 936843ad..9ebfbda9 100644 --- a/src/cocoa_platform.h +++ b/src/cocoa_platform.h @@ -218,7 +218,7 @@ GLFWbool _glfwCreateWindowCocoa(_GLFWwindow* window, const _GLFWwndconfig* wndco void _glfwDestroyWindowCocoa(_GLFWwindow* window); void _glfwSetWindowTitleCocoa(_GLFWwindow* window, const char* title); void _glfwSetWindowIconCocoa(_GLFWwindow* window, int count, const GLFWimage* images); -void _glfwSetWindowTaskbarProgressCocoa(_GLFWwindow* window, const int taskbarState, int completed); +void _glfwSetWindowTaskbarProgressCocoa(_GLFWwindow* window, const int taskbarState, int value); 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 76d84c14..3b2c6dae 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -1032,7 +1032,7 @@ void _glfwSetWindowIconCocoa(_GLFWwindow* window, "Cocoa: Regular windows do not have icons on macOS"); } -void _glfwSetWindowTaskbarProgressCocoa(_GLFWwindow* window, const int progressState, int completed) +void _glfwSetWindowTaskbarProgressCocoa(_GLFWwindow* window, const int progressState, int value) { _glfwInputError(GLFW_FEATURE_UNIMPLEMENTED, "Cocoa: Window taskbar progress is not implemented"); diff --git a/src/null_platform.h b/src/null_platform.h index 348ded2e..80e2946f 100644 --- a/src/null_platform.h +++ b/src/null_platform.h @@ -89,7 +89,7 @@ GLFWbool _glfwCreateWindowNull(_GLFWwindow* window, const _GLFWwndconfig* wndcon void _glfwDestroyWindowNull(_GLFWwindow* window); void _glfwSetWindowTitleNull(_GLFWwindow* window, const char* title); void _glfwSetWindowIconNull(_GLFWwindow* window, int count, const GLFWimage* images); -void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, const int taskbarState, int completed); +void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, const int taskbarState, int value); 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 f7dafbc2..bbb30e68 100644 --- a/src/null_window.c +++ b/src/null_window.c @@ -187,7 +187,7 @@ void _glfwSetWindowIconNull(_GLFWwindow* window, int count, const GLFWimage* ima { } -void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, const int progressState, int completed) +void _glfwSetWindowTaskbarProgressNull(_GLFWwindow* window, const int progressState, int value) { } diff --git a/src/win32_platform.h b/src/win32_platform.h index 44b8006a..9ec1174b 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -618,7 +618,7 @@ GLFWbool _glfwCreateWindowWin32(_GLFWwindow* window, const _GLFWwndconfig* wndco void _glfwDestroyWindowWin32(_GLFWwindow* window); void _glfwSetWindowTitleWin32(_GLFWwindow* window, const char* title); void _glfwSetWindowIconWin32(_GLFWwindow* window, int count, const GLFWimage* images); -void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, const int taskbarState, int completed); +void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, const int taskbarState, int value); 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 fe4c2b56..2f8d7a0e 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1596,7 +1596,7 @@ void _glfwSetWindowIconWin32(_GLFWwindow* window, int count, const GLFWimage* im } } -void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, const int progressState, int completed) +void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, const int progressState, int value) { HRESULT res = S_OK; int32_t winProgressState = 0; @@ -1610,7 +1610,7 @@ void _glfwSetWindowTaskbarProgressWin32(_GLFWwindow* window, const int progressS if(!window->win32.TaskbarList) return; - res = window->win32.TaskbarList->lpVtbl->SetProgressValue(window->win32.TaskbarList, window->win32.handle, completed, 100); + res = window->win32.TaskbarList->lpVtbl->SetProgressValue(window->win32.TaskbarList, window->win32.handle, value, 100); if(res != S_OK) { _glfwInputErrorWin32(GLFW_PLATFORM_ERROR, "Win32: Failed to set taskbar progress value"); diff --git a/src/window.c b/src/window.c index aeeb45f8..46dff20c 100644 --- a/src/window.c +++ b/src/window.c @@ -558,7 +558,7 @@ GLFWAPI void glfwSetWindowIcon(GLFWwindow* handle, _glfw.platform.setWindowIcon(window, count, images); } -GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* handle, const int progressState, int completed) +GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* handle, const int progressState, int value) { _GLFWwindow* window = (_GLFWwindow*) handle; @@ -566,12 +566,7 @@ GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* handle, const int progress _GLFW_REQUIRE_INIT(); - if (completed < 0) - { - _glfwInputError(GLFW_INVALID_VALUE, "Invalid progress amount for window taskbar progress"); - return; - } - else if (completed > 100) + if (value < 0 || value > 100) { _glfwInputError(GLFW_INVALID_VALUE, "Invalid progress amount for window taskbar progress"); return; @@ -585,7 +580,7 @@ GLFWAPI void glfwSetWindowTaskbarProgress(GLFWwindow* handle, const int progress return; } - _glfw.platform.setWindowTaskbarProgress(window, progressState, completed); + _glfw.platform.setWindowTaskbarProgress(window, progressState, value); } GLFWAPI void glfwGetWindowPos(GLFWwindow* handle, int* xpos, int* ypos) @@ -1182,3 +1177,4 @@ GLFWAPI void glfwPostEmptyEvent(void) _GLFW_REQUIRE_INIT(); _glfw.platform.postEmptyEvent(); } + diff --git a/src/wl_platform.h b/src/wl_platform.h index c5152af3..eaa29d87 100644 --- a/src/wl_platform.h +++ b/src/wl_platform.h @@ -446,7 +446,7 @@ GLFWbool _glfwCreateWindowWayland(_GLFWwindow* window, const _GLFWwndconfig* wnd void _glfwDestroyWindowWayland(_GLFWwindow* window); void _glfwSetWindowTitleWayland(_GLFWwindow* window, const char* title); void _glfwSetWindowIconWayland(_GLFWwindow* window, int count, const GLFWimage* images); -void _glfwSetWindowTaskbarProgressWayland(_GLFWwindow* window, const int taskbarState, int completed); +void _glfwSetWindowTaskbarProgressWayland(_GLFWwindow* window, const int taskbarState, int value); 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 dacecfcb..df7339bf 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1902,12 +1902,12 @@ void _glfwSetWindowIconWayland(_GLFWwindow* window, "Wayland: The platform does not support setting the window icon"); } -void _glfwSetWindowTaskbarProgressWayland(_GLFWwindow* window, const int taskbarState, int completed) +void _glfwSetWindowTaskbarProgressWayland(_GLFWwindow* window, const int taskbarState, int value) { (void)window; - const double progressValue = (double)completed / 100.0; const dbus_bool_t progressVisible = (taskbarState != GLFW_TASKBAR_PROGRESS_DISABLED); + const double progressValue = (double)value / 100.0; _glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, progressValue); } @@ -2901,3 +2901,4 @@ GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* handle) } #endif // _GLFW_WAYLAND + diff --git a/src/x11_platform.h b/src/x11_platform.h index f49867c0..20766834 100644 --- a/src/x11_platform.h +++ b/src/x11_platform.h @@ -905,7 +905,7 @@ GLFWbool _glfwCreateWindowX11(_GLFWwindow* window, const _GLFWwndconfig* wndconf void _glfwDestroyWindowX11(_GLFWwindow* window); void _glfwSetWindowTitleX11(_GLFWwindow* window, const char* title); void _glfwSetWindowIconX11(_GLFWwindow* window, int count, const GLFWimage* images); -void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, const int taskbarState, int completed); +void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, const int taskbarState, int value); 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 e95cf588..d2583608 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -2152,12 +2152,12 @@ void _glfwSetWindowIconX11(_GLFWwindow* window, int count, const GLFWimage* imag XFlush(_glfw.x11.display); } -void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, const int taskbarState, int completed) +void _glfwSetWindowTaskbarProgressX11(_GLFWwindow* window, const int taskbarState, int value) { (void)window; - const double progressValue = (double)completed / 100.0; const dbus_bool_t progressVisible = (taskbarState != GLFW_TASKBAR_PROGRESS_DISABLED); + const double progressValue = (double)value / 100.0; _glfwUpdateTaskbarProgressDBusPOSIX(progressVisible, progressValue); } @@ -3362,3 +3362,4 @@ GLFWAPI const char* glfwGetX11SelectionString(void) } #endif // _GLFW_X11 +