Added requests to store window rectangles in the server.
diff --git a/server/window.c b/server/window.c
index ff9ba82..1559d44 100644
--- a/server/window.c
+++ b/server/window.c
@@ -40,6 +40,8 @@
user_handle_t handle; /* full handle for this window */
struct thread *thread; /* thread owning the window */
atom_t atom; /* class atom */
+ rectangle_t window_rect; /* window rectangle */
+ rectangle_t client_rect; /* client rectangle */
int prop_inuse; /* number of in-use window properties */
int prop_alloc; /* number of allocated window properties */
struct property *properties; /* window properties array */
@@ -476,6 +478,61 @@
}
+/* set the window and client rectangles of a window */
+DECL_HANDLER(set_window_rectangles)
+{
+ struct window *win = get_window( req->handle );
+
+ if (win)
+ {
+ win->window_rect = req->window;
+ win->client_rect = req->client;
+ }
+}
+
+
+/* get the window and client rectangles of a window */
+DECL_HANDLER(get_window_rectangles)
+{
+ struct window *win = get_window( req->handle );
+
+ if (win)
+ {
+ req->window = win->window_rect;
+ req->client = win->client_rect;
+ }
+}
+
+
+/* get the coordinates offset between two windows */
+DECL_HANDLER(get_windows_offset)
+{
+ struct window *win;
+
+ req->x = req->y = 0;
+ if (req->from)
+ {
+ if (!(win = get_window( req->from ))) return;
+ while (win)
+ {
+ req->x += win->client_rect.left;
+ req->y += win->client_rect.top;
+ win = win->parent;
+ }
+ }
+ if (req->to)
+ {
+ if (!(win = get_window( req->to ))) return;
+ while (win)
+ {
+ req->x -= win->client_rect.left;
+ req->y -= win->client_rect.top;
+ win = win->parent;
+ }
+ }
+}
+
+
/* set a window property */
DECL_HANDLER(set_window_property)
{