diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 23 | ||||
| -rw-r--r-- | src/config.in | 3 | ||||
| -rw-r--r-- | src/image.c | 11 | ||||
| -rw-r--r-- | src/xfns.c | 39 | ||||
| -rw-r--r-- | src/xterm.c | 2 | ||||
| -rw-r--r-- | src/xterm.h | 4 |
6 files changed, 70 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5a0d859ac27..985a07c4ea3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,26 @@ | |||
| 1 | 2010-11-09 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xfns.c (x_real_positions): Fix declaration-after-statement | ||
| 4 | problem. | ||
| 5 | |||
| 6 | 2010-11-09 Chong Yidong <cyd@stupidchicken.com> | ||
| 7 | |||
| 8 | * image.c (free_image): Don't garbage the frame here, since this | ||
| 9 | function can be called while redisplaying (Bug#7210). | ||
| 10 | (uncache_image): Garbage the frame here (Bug#6426). | ||
| 11 | |||
| 12 | 2010-11-09 Jan Djärv <jan.h.d@swipnet.se> | ||
| 13 | |||
| 14 | * xfns.c (x_real_positions): Only use _NET_FRAME_EXTENTS if our | ||
| 15 | parent is the root window. Check this after traversing window tree. | ||
| 16 | |||
| 17 | * xterm.c (x_term_init): Initialize Xatom_net_frame_extents. | ||
| 18 | |||
| 19 | * xterm.h (struct x_display_info): Xatom_net_frame_extents is new. | ||
| 20 | |||
| 21 | * xfns.c (x_real_positions): Try to get _NET_FRAME_EXTENTS first | ||
| 22 | before traversing window tree (Bug#5721). | ||
| 23 | |||
| 1 | 2010-11-07 Jan Djärv <jan.h.d@swipnet.se> | 24 | 2010-11-07 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 25 | ||
| 3 | * xfns.c (set_machine_and_pid_properties): Let X set WM_CLIENT_MACHINE. | 26 | * xfns.c (set_machine_and_pid_properties): Let X set WM_CLIENT_MACHINE. |
diff --git a/src/config.in b/src/config.in index 5b042ce8eff..1846bfb9e7b 100644 --- a/src/config.in +++ b/src/config.in | |||
| @@ -1059,9 +1059,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 1059 | /* Define to `int' if <sys/types.h> does not define. */ | 1059 | /* Define to `int' if <sys/types.h> does not define. */ |
| 1060 | #undef pid_t | 1060 | #undef pid_t |
| 1061 | 1061 | ||
| 1062 | /* Define to `unsigned int' if <sys/types.h> does not define. */ | ||
| 1063 | #undef size_t | ||
| 1064 | |||
| 1065 | /* Define to any substitute for sys_siglist. */ | 1062 | /* Define to any substitute for sys_siglist. */ |
| 1066 | #undef sys_siglist | 1063 | #undef sys_siglist |
| 1067 | 1064 | ||
diff --git a/src/image.c b/src/image.c index 083d0720c15..828c2d319be 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -1049,10 +1049,6 @@ free_image (struct frame *f, struct image *img) | |||
| 1049 | /* Free resources, then free IMG. */ | 1049 | /* Free resources, then free IMG. */ |
| 1050 | img->type->free (f, img); | 1050 | img->type->free (f, img); |
| 1051 | xfree (img); | 1051 | xfree (img); |
| 1052 | |||
| 1053 | /* As display glyphs may still be referring to the image ID, we | ||
| 1054 | must garbage the frame (Bug#6426). */ | ||
| 1055 | SET_FRAME_GARBAGED (f); | ||
| 1056 | } | 1052 | } |
| 1057 | } | 1053 | } |
| 1058 | 1054 | ||
| @@ -1471,7 +1467,12 @@ uncache_image (struct frame *f, Lisp_Object spec) | |||
| 1471 | { | 1467 | { |
| 1472 | struct image *img = search_image_cache (f, spec, sxhash (spec, 0)); | 1468 | struct image *img = search_image_cache (f, spec, sxhash (spec, 0)); |
| 1473 | if (img) | 1469 | if (img) |
| 1474 | free_image (f, img); | 1470 | { |
| 1471 | free_image (f, img); | ||
| 1472 | /* As display glyphs may still be referring to the image ID, we | ||
| 1473 | must garbage the frame (Bug#6426). */ | ||
| 1474 | SET_FRAME_GARBAGED (f); | ||
| 1475 | } | ||
| 1475 | } | 1476 | } |
| 1476 | 1477 | ||
| 1477 | 1478 | ||
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; |
diff --git a/src/xterm.c b/src/xterm.c index 7297ee71f0f..4c0493891e3 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -10278,6 +10278,8 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 10278 | = XInternAtom (dpyinfo->display, "_NET_WM_ICON_NAME", False); | 10278 | = XInternAtom (dpyinfo->display, "_NET_WM_ICON_NAME", False); |
| 10279 | dpyinfo->Xatom_net_wm_name | 10279 | dpyinfo->Xatom_net_wm_name |
| 10280 | = XInternAtom (dpyinfo->display, "_NET_WM_NAME", False); | 10280 | = XInternAtom (dpyinfo->display, "_NET_WM_NAME", False); |
| 10281 | dpyinfo->Xatom_net_frame_extents | ||
| 10282 | = XInternAtom (dpyinfo->display, "_NET_FRAME_EXTENTS", False); | ||
| 10281 | 10283 | ||
| 10282 | dpyinfo->x_dnd_atoms_size = 8; | 10284 | dpyinfo->x_dnd_atoms_size = 8; |
| 10283 | dpyinfo->x_dnd_atoms_length = 0; | 10285 | dpyinfo->x_dnd_atoms_length = 0; |
diff --git a/src/xterm.h b/src/xterm.h index ec99a659b8e..1d144b3b704 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -337,10 +337,10 @@ struct x_display_info | |||
| 337 | Window net_supported_window; | 337 | Window net_supported_window; |
| 338 | Atom Xatom_net_window_type, Xatom_net_window_type_tooltip; | 338 | Atom Xatom_net_window_type, Xatom_net_window_type_tooltip; |
| 339 | 339 | ||
| 340 | /* Atoms dealing with maximization and fullscreen */ | 340 | /* Atoms dealing with EWMH (i.e. _NET_...) */ |
| 341 | Atom Xatom_net_wm_state, Xatom_net_wm_state_fullscreen_atom, | 341 | Atom Xatom_net_wm_state, Xatom_net_wm_state_fullscreen_atom, |
| 342 | Xatom_net_wm_state_maximized_horz, Xatom_net_wm_state_maximized_vert, | 342 | Xatom_net_wm_state_maximized_horz, Xatom_net_wm_state_maximized_vert, |
| 343 | Xatom_net_wm_state_sticky; | 343 | Xatom_net_wm_state_sticky, Xatom_net_frame_extents; |
| 344 | 344 | ||
| 345 | /* XSettings atoms and windows. */ | 345 | /* XSettings atoms and windows. */ |
| 346 | Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr; | 346 | Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr; |