|
@@ -43,6 +43,7 @@
|
|
|
#define _NET_WM_STATE_REMOVE 0
|
|
|
#define _NET_WM_STATE_ADD 1
|
|
|
#define _NET_WM_STATE_TOGGLE 2
|
|
|
+#define _NET_WM_MOVERESIZE_MOVE 8
|
|
|
|
|
|
// Additional mouse button names for XButtonEvent
|
|
|
#define Button6 6
|
|
@@ -2143,6 +2144,28 @@ void _glfwPlatformFocusWindow(_GLFWwindow* window)
|
|
|
XFlush(_glfw.x11.display);
|
|
|
}
|
|
|
|
|
|
+void _glfwPlatformDragWindow(_GLFWwindow* window)
|
|
|
+{
|
|
|
+ int winXpos, winYpos;
|
|
|
+ double curXpos, curYpos;
|
|
|
+ XClientMessageEvent xclient;
|
|
|
+ memset(&xclient, 0, sizeof(XClientMessageEvent));
|
|
|
+ XUngrabPointer(_glfw.x11.display, 0);
|
|
|
+ XFlush(_glfw.x11.display);
|
|
|
+ _glfwPlatformGetCursorPos(window, &curXpos, &curYpos);
|
|
|
+ _glfwPlatformGetWindowPos(window, &winXpos, &winYpos);
|
|
|
+ xclient.type = ClientMessage;
|
|
|
+ xclient.window = window->x11.handle;
|
|
|
+ xclient.message_type = XInternAtom(_glfw.x11.display, "_NET_WM_MOVERESIZE", False);
|
|
|
+ xclient.format = 32;
|
|
|
+ xclient.data.l[0] = winXpos + curXpos;
|
|
|
+ xclient.data.l[1] = winYpos + curYpos;
|
|
|
+ xclient.data.l[2] = _NET_WM_MOVERESIZE_MOVE;
|
|
|
+ xclient.data.l[3] = 0;
|
|
|
+ xclient.data.l[4] = 0;
|
|
|
+ XSendEvent(_glfw.x11.display, _glfw.x11.root, False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xclient);
|
|
|
+}
|
|
|
+
|
|
|
void _glfwPlatformSetWindowMonitor(_GLFWwindow* window,
|
|
|
_GLFWmonitor* monitor,
|
|
|
int xpos, int ypos,
|