mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
Added GLFW_WIN32_GENERIC_BADGE window hint
This commit is contained in:
parent
367a50e82d
commit
de81fae268
@ -1117,6 +1117,7 @@ extern "C" {
|
||||
*/
|
||||
#define GLFW_X11_INSTANCE_NAME 0x00024002
|
||||
#define GLFW_WIN32_KEYBOARD_MENU 0x00025001
|
||||
#define GLFW_WIN32_GENERIC_BADGE 0x00025002
|
||||
/*! @brief Wayland specific
|
||||
* [window hint](@ref GLFW_WAYLAND_APP_ID_hint).
|
||||
*
|
||||
|
@ -415,6 +415,7 @@ struct _GLFWwndconfig
|
||||
} x11;
|
||||
struct {
|
||||
GLFWbool keymenu;
|
||||
GLFWbool genericBadge;
|
||||
} win32;
|
||||
struct {
|
||||
char appId[256];
|
||||
|
@ -497,6 +497,7 @@ typedef struct _GLFWwindowWin32
|
||||
GLFWbool transparent;
|
||||
GLFWbool scaleToMonitor;
|
||||
GLFWbool keymenu;
|
||||
GLFWbool genericBadge;
|
||||
|
||||
// Cached size used to filter out duplicate events
|
||||
int width, height;
|
||||
|
@ -1384,6 +1384,7 @@ static int createNativeWindow(_GLFWwindow* window,
|
||||
|
||||
window->win32.scaleToMonitor = wndconfig->scaleToMonitor;
|
||||
window->win32.keymenu = wndconfig->win32.keymenu;
|
||||
window->win32.genericBadge = wndconfig->win32.genericBadge;
|
||||
|
||||
if (!window->monitor)
|
||||
{
|
||||
@ -2046,8 +2047,11 @@ void _glfwSetWindowBadgeWin32(_GLFWwindow* window, int count)
|
||||
}
|
||||
|
||||
count = min(count, 999);
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
if (window->win32.genericBadge)
|
||||
icon = GenerateGenericBadgeIcon(window->win32.handle);
|
||||
else
|
||||
{
|
||||
//Convert count to string (its guaranteed to be at max 3 digits)
|
||||
memset(countStr, 0, 4 * sizeof(char));
|
||||
@ -2060,6 +2064,8 @@ void _glfwSetWindowBadgeWin32(_GLFWwindow* window, int count)
|
||||
}
|
||||
|
||||
icon = GenerateTextBadgeIcon(window->win32.handle, countWStr);
|
||||
}
|
||||
|
||||
if (!icon)
|
||||
{
|
||||
_glfwInputErrorWin32(GLFW_PLATFORM_ERROR, "Win32: Failed to set taskbar badge count");
|
||||
|
@ -382,6 +382,9 @@ GLFWAPI void glfwWindowHint(int hint, int value)
|
||||
case GLFW_WIN32_KEYBOARD_MENU:
|
||||
_glfw.hints.window.win32.keymenu = value ? GLFW_TRUE : GLFW_FALSE;
|
||||
return;
|
||||
case GLFW_WIN32_GENERIC_BADGE:
|
||||
_glfw.hints.window.win32.genericBadge = value ? GLFW_TRUE : GLFW_FALSE;
|
||||
return;
|
||||
case GLFW_COCOA_GRAPHICS_SWITCHING:
|
||||
_glfw.hints.context.nsgl.offline = value ? GLFW_TRUE : GLFW_FALSE;
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user