aboutsummaryrefslogtreecommitdiffstats
path: root/src/xfns.c
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1994-05-08 21:03:21 +0000
committerRichard M. Stallman <[email protected]>1994-05-08 21:03:21 +0000
commite9445337f786880b2f4ccbbdd85b3606be03f238 (patch)
tree83bd1fa05c02e9b399d910d59d6afc6e4ca8a505 /src/xfns.c
parentfa974a004ae8d3cc53dd4240e919898222ebbe54 (diff)
(x_real_positions): New function.
Diffstat (limited to 'src/xfns.c')
-rw-r--r--src/xfns.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 79a2b2b347..c0313b20b0 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -547,6 +547,47 @@ x_set_frame_parameters (f, alist)
}
}
+/* Store the positions of frame F into XPTR and YPTR.
+ These are the positions of the containing window manager window,
+ not Emacs's own window. */
+
+void
+x_real_positions (f, xptr, yptr)
+ FRAME_PTR f;
+ int *xptr, *yptr;
+{
+ int win_x = 0, win_y = 0;
+ Window child;
+
+ /* Find the position of the outside upper-left corner of
+ the inner window, with respect to the outer window. */
+ if (f->display.x->parent_desc != ROOT_WINDOW)
+ {
+ BLOCK_INPUT;
+ XTranslateCoordinates (x_current_display,
+
+ /* From-window, to-window. */
+#ifdef USE_X_TOOLKIT
+ XtWindow (f->display.x->widget),
+#else
+ f->display.x->window_desc,
+#endif
+ f->display.x->parent_desc,
+
+ /* From-position, to-position. */
+ 0, 0, &win_x, &win_y,
+
+ /* Child of win. */
+ &child);
+ UNBLOCK_INPUT;
+
+ win_x += f->display.x->border_width;
+ win_y += f->display.x->border_width;
+ }
+ *xptr = f->display.x->left_pos - win_x;
+ *yptr = f->display.x->top_pos - win_y;
+}
+
/* Insert a description of internally-recorded parameters of frame X
into the parameter alist *ALISTPTR that is to be given to the user.
Only parameters that are specific to the X window system