aboutsummaryrefslogtreecommitdiffstats
path: root/src/xfns.c
diff options
context:
space:
mode:
authorStefan Monnier2010-11-09 15:07:10 -0500
committerStefan Monnier2010-11-09 15:07:10 -0500
commitd607b96bc2824116a8fe0e5840ce49da7ce4514f (patch)
tree229a11bba88b67e8961db4d10aa8b3725f3a4873 /src/xfns.c
parent27410d0ac3406a341cc90ada064047a7f1ea5209 (diff)
parentc00980655bc15ca019fd6c559c69601be18f2407 (diff)
downloademacs-d607b96bc2824116a8fe0e5840ce49da7ce4514f.tar.gz
emacs-d607b96bc2824116a8fe0e5840ce49da7ce4514f.zip
Merge from emacs-23
Diffstat (limited to 'src/xfns.c')
-rw-r--r--src/xfns.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 576ab3f0ef1..28566eb9a64 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -519,12 +519,20 @@ x_real_positions (FRAME_PTR f, int *xptr, int *yptr)
519 int real_x = 0, real_y = 0; 519 int real_x = 0, real_y = 0;
520 int had_errors = 0; 520 int had_errors = 0;
521 Window win = f->output_data.x->parent_desc; 521 Window win = f->output_data.x->parent_desc;
522 Atom actual_type;
523 unsigned long actual_size, bytes_remaining;
524 int i, rc, actual_format;
525 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
526 long max_len = 400;
527 Display *dpy = FRAME_X_DISPLAY (f);
528 unsigned char *tmp_data = NULL;
529 Atom target_type = XA_CARDINAL;
522 530
523 BLOCK_INPUT; 531 BLOCK_INPUT;
524 532
525 x_catch_errors (FRAME_X_DISPLAY (f)); 533 x_catch_errors (dpy);
526 534
527 if (win == FRAME_X_DISPLAY_INFO (f)->root_window) 535 if (win == dpyinfo->root_window)
528 win = FRAME_OUTER_WINDOW (f); 536 win = FRAME_OUTER_WINDOW (f);
529 537
530 /* This loop traverses up the containment tree until we hit the root 538 /* This loop traverses up the containment tree until we hit the root
@@ -609,6 +617,33 @@ x_real_positions (FRAME_PTR f, int *xptr, int *yptr)
609 had_errors = x_had_errors_p (FRAME_X_DISPLAY (f)); 617 had_errors = x_had_errors_p (FRAME_X_DISPLAY (f));
610 } 618 }
611 619
620
621 if (dpyinfo->root_window == f->output_data.x->parent_desc)
622 {
623 /* Try _NET_FRAME_EXTENTS if our parent is the root window. */
624 rc = XGetWindowProperty (dpy, win, dpyinfo->Xatom_net_frame_extents,
625 0, max_len, False, target_type,
626 &actual_type, &actual_format, &actual_size,
627 &bytes_remaining, &tmp_data);
628
629 if (rc == Success && actual_type == target_type && !x_had_errors_p (dpy)
630 && actual_size == 4 && actual_format == 32)
631 {
632 int ign;
633 Window rootw;
634 long *fe = (long *)tmp_data;
635
636 XGetGeometry (FRAME_X_DISPLAY (f), win,
637 &rootw, &real_x, &real_y, &ign, &ign, &ign, &ign);
638 outer_x = -fe[0];
639 outer_y = -fe[2];
640 real_x -= fe[0];
641 real_y -= fe[2];
642 }
643 }
644
645 if (tmp_data) XFree (tmp_data);
646
612 x_uncatch_errors (); 647 x_uncatch_errors ();
613 648
614 UNBLOCK_INPUT; 649 UNBLOCK_INPUT;