1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-30 05:58:52 -05:00

Added support for _NET_WM_ICON_NAME.

This commit is contained in:
Camilla Berglund 2012-02-02 17:20:14 +01:00
parent 797e936311
commit 06074bc698
2 changed files with 14 additions and 1 deletions

View File

@ -142,6 +142,7 @@ typedef struct _GLFWwindowX11
Window handle; // Window handle Window handle; // Window handle
Atom wmDeleteWindow; // WM_DELETE_WINDOW atom Atom wmDeleteWindow; // WM_DELETE_WINDOW atom
Atom wmName; // _NET_WM_NAME atom Atom wmName; // _NET_WM_NAME atom
Atom wmIconName; // _NET_WM_ICON_NAME atom
Atom wmPing; // _NET_WM_PING atom Atom wmPing; // _NET_WM_PING atom
Atom wmState; // _NET_WM_STATE atom Atom wmState; // _NET_WM_STATE atom
Atom wmStateFullscreen; // _NET_WM_STATE_FULLSCREEN atom Atom wmStateFullscreen; // _NET_WM_STATE_FULLSCREEN atom

View File

@ -198,6 +198,9 @@ static GLboolean hasEWMH(_GLFWwindow* window)
window->X11.wmName = window->X11.wmName =
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_NAME"); getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_NAME");
window->X11.wmIconName =
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_ICON_NAME");
window->X11.wmPing = window->X11.wmPing =
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_PING"); getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_PING");
@ -1512,6 +1515,8 @@ void _glfwPlatformCloseWindow(_GLFWwindow* window)
void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
{ {
Atom type = XInternAtom(_glfwLibrary.X11.display, "UTF8_STRING", False);
#if defined(X_HAVE_UTF8_STRING) #if defined(X_HAVE_UTF8_STRING)
Xutf8SetWMProperties(_glfwLibrary.X11.display, Xutf8SetWMProperties(_glfwLibrary.X11.display,
window->X11.handle, window->X11.handle,
@ -1530,12 +1535,19 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
if (window->X11.wmName != None) if (window->X11.wmName != None)
{ {
Atom type = XInternAtom(_glfwLibrary.X11.display, "UTF8_STRING", False);
XChangeProperty(_glfwLibrary.X11.display, window->X11.handle, XChangeProperty(_glfwLibrary.X11.display, window->X11.handle,
window->X11.wmName, type, 8, window->X11.wmName, type, 8,
PropModeReplace, PropModeReplace,
(unsigned char*) title, strlen(title)); (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));
}
} }