mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 14:24:35 +00:00
Cleanup.
This commit is contained in:
parent
5ef4f77fb5
commit
823cc38ac1
@ -205,13 +205,13 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||||||
|
|
||||||
// The WM_DELETE_WINDOW ICCCM protocol
|
// The WM_DELETE_WINDOW ICCCM protocol
|
||||||
// Basic window close notification protocol
|
// Basic window close notification protocol
|
||||||
if (_glfw.x11.WM_DELETE_WINDOW != None)
|
if (_glfw.x11.WM_DELETE_WINDOW)
|
||||||
protocols[count++] = _glfw.x11.WM_DELETE_WINDOW;
|
protocols[count++] = _glfw.x11.WM_DELETE_WINDOW;
|
||||||
|
|
||||||
// The _NET_WM_PING EWMH protocol
|
// The _NET_WM_PING EWMH protocol
|
||||||
// Tells the WM to ping the GLFW window and flag the application as
|
// Tells the WM to ping the GLFW window and flag the application as
|
||||||
// unresponsive if the WM doesn't get a reply within a few seconds
|
// unresponsive if the WM doesn't get a reply within a few seconds
|
||||||
if (_glfw.x11.NET_WM_PING != None)
|
if (_glfw.x11.NET_WM_PING)
|
||||||
protocols[count++] = _glfw.x11.NET_WM_PING;
|
protocols[count++] = _glfw.x11.NET_WM_PING;
|
||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
@ -221,7 +221,7 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_glfw.x11.NET_WM_PID != None)
|
if (_glfw.x11.NET_WM_PID)
|
||||||
{
|
{
|
||||||
const pid_t pid = getpid();
|
const pid_t pid = getpid();
|
||||||
|
|
||||||
@ -399,7 +399,7 @@ static void enterFullscreenMode(_GLFWwindow* window)
|
|||||||
|
|
||||||
_glfwSetVideoMode(window->monitor, &window->videoMode);
|
_glfwSetVideoMode(window->monitor, &window->videoMode);
|
||||||
|
|
||||||
if (_glfw.x11.NET_WM_BYPASS_COMPOSITOR != None)
|
if (_glfw.x11.NET_WM_BYPASS_COMPOSITOR)
|
||||||
{
|
{
|
||||||
const unsigned long value = 1;
|
const unsigned long value = 1;
|
||||||
|
|
||||||
@ -408,15 +408,13 @@ static void enterFullscreenMode(_GLFWwindow* window)
|
|||||||
PropModeReplace, (unsigned char*) &value, 1);
|
PropModeReplace, (unsigned char*) &value, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_glfw.x11.hasEWMH &&
|
if (_glfw.x11.NET_WM_STATE && _glfw.x11.NET_WM_STATE_FULLSCREEN)
|
||||||
_glfw.x11.NET_WM_STATE != None &&
|
|
||||||
_glfw.x11.NET_WM_STATE_FULLSCREEN != None)
|
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
_glfwPlatformGetMonitorPos(window->monitor, &x, &y);
|
_glfwPlatformGetMonitorPos(window->monitor, &x, &y);
|
||||||
_glfwPlatformSetWindowPos(window, x, y);
|
_glfwPlatformSetWindowPos(window, x, y);
|
||||||
|
|
||||||
if (_glfw.x11.NET_ACTIVE_WINDOW != None)
|
if (_glfw.x11.NET_ACTIVE_WINDOW)
|
||||||
{
|
{
|
||||||
// Ask the window manager to raise and focus the GLFW window
|
// Ask the window manager to raise and focus the GLFW window
|
||||||
// Only focused windows with the _NET_WM_STATE_FULLSCREEN state end
|
// Only focused windows with the _NET_WM_STATE_FULLSCREEN state end
|
||||||
@ -496,7 +494,7 @@ static void leaveFullscreenMode(_GLFWwindow* window)
|
|||||||
_glfw.x11.saver.exposure);
|
_glfw.x11.saver.exposure);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_glfw.x11.NET_WM_BYPASS_COMPOSITOR != None)
|
if (_glfw.x11.NET_WM_BYPASS_COMPOSITOR)
|
||||||
{
|
{
|
||||||
const unsigned long value = 0;
|
const unsigned long value = 0;
|
||||||
|
|
||||||
@ -505,9 +503,7 @@ static void leaveFullscreenMode(_GLFWwindow* window)
|
|||||||
PropModeReplace, (unsigned char*) &value, 1);
|
PropModeReplace, (unsigned char*) &value, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_glfw.x11.hasEWMH &&
|
if (_glfw.x11.NET_WM_STATE && _glfw.x11.NET_WM_STATE_FULLSCREEN)
|
||||||
_glfw.x11.NET_WM_STATE != None &&
|
|
||||||
_glfw.x11.NET_WM_STATE_FULLSCREEN != None)
|
|
||||||
{
|
{
|
||||||
// Ask the window manager to make the GLFW window a normal window
|
// Ask the window manager to make the GLFW window a normal window
|
||||||
// Normal windows usually have frames and other decorations
|
// Normal windows usually have frames and other decorations
|
||||||
@ -735,7 +731,7 @@ static void processEvent(XEvent *event)
|
|||||||
|
|
||||||
_glfwInputWindowCloseRequest(window);
|
_glfwInputWindowCloseRequest(window);
|
||||||
}
|
}
|
||||||
else if (_glfw.x11.NET_WM_PING != None &&
|
else if (_glfw.x11.NET_WM_PING &&
|
||||||
(Atom) event->xclient.data.l[0] == _glfw.x11.NET_WM_PING)
|
(Atom) event->xclient.data.l[0] == _glfw.x11.NET_WM_PING)
|
||||||
{
|
{
|
||||||
// The window manager is pinging the application to ensure it's
|
// The window manager is pinging the application to ensure it's
|
||||||
@ -1017,7 +1013,7 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
|
|||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (_glfw.x11.NET_WM_NAME != None)
|
if (_glfw.x11.NET_WM_NAME)
|
||||||
{
|
{
|
||||||
XChangeProperty(_glfw.x11.display, window->x11.handle,
|
XChangeProperty(_glfw.x11.display, window->x11.handle,
|
||||||
_glfw.x11.NET_WM_NAME, _glfw.x11.UTF8_STRING, 8,
|
_glfw.x11.NET_WM_NAME, _glfw.x11.UTF8_STRING, 8,
|
||||||
@ -1025,7 +1021,7 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
|
|||||||
(unsigned char*) title, strlen(title));
|
(unsigned char*) title, strlen(title));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_glfw.x11.NET_WM_ICON_NAME != None)
|
if (_glfw.x11.NET_WM_ICON_NAME)
|
||||||
{
|
{
|
||||||
XChangeProperty(_glfw.x11.display, window->x11.handle,
|
XChangeProperty(_glfw.x11.display, window->x11.handle,
|
||||||
_glfw.x11.NET_WM_ICON_NAME, _glfw.x11.UTF8_STRING, 8,
|
_glfw.x11.NET_WM_ICON_NAME, _glfw.x11.UTF8_STRING, 8,
|
||||||
@ -1042,7 +1038,7 @@ void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
|
|||||||
XTranslateCoordinates(_glfw.x11.display, window->x11.handle, _glfw.x11.root,
|
XTranslateCoordinates(_glfw.x11.display, window->x11.handle, _glfw.x11.root,
|
||||||
0, 0, &x, &y, &child);
|
0, 0, &x, &y, &child);
|
||||||
|
|
||||||
if (child != None)
|
if (child)
|
||||||
{
|
{
|
||||||
int left, top;
|
int left, top;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user