mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Merge branch 'master' into cursor-enter-leave
This commit is contained in:
+42
-6
@@ -195,6 +195,12 @@ static GLboolean hasEWMH(_GLFWwindow* window)
|
||||
window->X11.wmStateFullscreen =
|
||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE_FULLSCREEN");
|
||||
|
||||
window->X11.wmName =
|
||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_NAME");
|
||||
|
||||
window->X11.wmIconName =
|
||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_ICON_NAME");
|
||||
|
||||
window->X11.wmPing =
|
||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_PING");
|
||||
|
||||
@@ -310,7 +316,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
|
||||
}
|
||||
}
|
||||
|
||||
result = (_GLFWfbconfig*) _glfwMalloc(sizeof(_GLFWfbconfig) * count);
|
||||
result = (_GLFWfbconfig*) malloc(sizeof(_GLFWfbconfig) * count);
|
||||
if (!result)
|
||||
{
|
||||
_glfwSetError(GLFW_OUT_OF_MEMORY,
|
||||
@@ -1444,12 +1450,12 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
|
||||
result = _glfwChooseFBConfig(fbconfig, fbconfigs, fbcount);
|
||||
if (!result)
|
||||
{
|
||||
_glfwFree(fbconfigs);
|
||||
free(fbconfigs);
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
closest = *result;
|
||||
_glfwFree(fbconfigs);
|
||||
free(fbconfigs);
|
||||
}
|
||||
|
||||
if (!createContext(window, wndconfig, (GLXFBConfigID) closest.platformID))
|
||||
@@ -1544,9 +1550,39 @@ void _glfwPlatformCloseWindow(_GLFWwindow* window)
|
||||
|
||||
void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
|
||||
{
|
||||
// Set window & icon title
|
||||
XStoreName(_glfwLibrary.X11.display, window->X11.handle, title);
|
||||
XSetIconName(_glfwLibrary.X11.display, window->X11.handle, title);
|
||||
Atom type = XInternAtom(_glfwLibrary.X11.display, "UTF8_STRING", False);
|
||||
|
||||
#if defined(X_HAVE_UTF8_STRING)
|
||||
Xutf8SetWMProperties(_glfwLibrary.X11.display,
|
||||
window->X11.handle,
|
||||
title, title,
|
||||
NULL, 0,
|
||||
NULL, NULL, NULL);
|
||||
#else
|
||||
// This may be a slightly better fallback than using XStoreName and
|
||||
// XSetIconName, which always store their arguments using STRING
|
||||
XmbSetWMProperties(_glfwLibrary.X11.display,
|
||||
window->X11.handle,
|
||||
title, title,
|
||||
NULL, 0,
|
||||
NULL, NULL, NULL);
|
||||
#endif
|
||||
|
||||
if (window->X11.wmName != None)
|
||||
{
|
||||
XChangeProperty(_glfwLibrary.X11.display, window->X11.handle,
|
||||
window->X11.wmName, type, 8,
|
||||
PropModeReplace,
|
||||
(unsigned char*) title, strlen(title));
|
||||
}
|
||||
|
||||
if (window->X11.wmIconName != None)
|
||||
{
|
||||
XChangeProperty(_glfwLibrary.X11.display, window->X11.handle,
|
||||
window->X11.wmIconName, type, 8,
|
||||
PropModeReplace,
|
||||
(unsigned char*) title, strlen(title));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user