diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-11-09 15:07:10 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-11-09 15:07:10 -0500 |
commit | d607b96bc2824116a8fe0e5840ce49da7ce4514f (patch) | |
tree | 229a11bba88b67e8961db4d10aa8b3725f3a4873 /src | |
parent | 27410d0ac3406a341cc90ada064047a7f1ea5209 (diff) | |
parent | c00980655bc15ca019fd6c559c69601be18f2407 (diff) | |
download | emacs-d607b96bc2824116a8fe0e5840ce49da7ce4514f.tar.gz |
Merge from emacs-23
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 @@ +2010-11-09 Eli Zaretskii <eliz@gnu.org> + + * xfns.c (x_real_positions): Fix declaration-after-statement + problem. + +2010-11-09 Chong Yidong <cyd@stupidchicken.com> + + * image.c (free_image): Don't garbage the frame here, since this + function can be called while redisplaying (Bug#7210). + (uncache_image): Garbage the frame here (Bug#6426). + +2010-11-09 Jan Djärv <jan.h.d@swipnet.se> + + * xfns.c (x_real_positions): Only use _NET_FRAME_EXTENTS if our + parent is the root window. Check this after traversing window tree. + + * xterm.c (x_term_init): Initialize Xatom_net_frame_extents. + + * xterm.h (struct x_display_info): Xatom_net_frame_extents is new. + + * xfns.c (x_real_positions): Try to get _NET_FRAME_EXTENTS first + before traversing window tree (Bug#5721). + 2010-11-07 Jan Djärv <jan.h.d@swipnet.se> * 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/>. */ /* Define to `int' if <sys/types.h> does not define. */ #undef pid_t -/* Define to `unsigned int' if <sys/types.h> does not define. */ -#undef size_t - /* Define to any substitute for sys_siglist. */ #undef sys_siglist 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) /* Free resources, then free IMG. */ img->type->free (f, img); xfree (img); - - /* As display glyphs may still be referring to the image ID, we - must garbage the frame (Bug#6426). */ - SET_FRAME_GARBAGED (f); } } @@ -1471,7 +1467,12 @@ uncache_image (struct frame *f, Lisp_Object spec) { struct image *img = search_image_cache (f, spec, sxhash (spec, 0)); if (img) - free_image (f, img); + { + free_image (f, img); + /* As display glyphs may still be referring to the image ID, we + must garbage the frame (Bug#6426). */ + SET_FRAME_GARBAGED (f); + } } 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) int real_x = 0, real_y = 0; int had_errors = 0; Window win = f->output_data.x->parent_desc; + Atom actual_type; + unsigned long actual_size, bytes_remaining; + int i, rc, actual_format; + struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + long max_len = 400; + Display *dpy = FRAME_X_DISPLAY (f); + unsigned char *tmp_data = NULL; + Atom target_type = XA_CARDINAL; BLOCK_INPUT; - x_catch_errors (FRAME_X_DISPLAY (f)); + x_catch_errors (dpy); - if (win == FRAME_X_DISPLAY_INFO (f)->root_window) + if (win == dpyinfo->root_window) win = FRAME_OUTER_WINDOW (f); /* 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) had_errors = x_had_errors_p (FRAME_X_DISPLAY (f)); } + + if (dpyinfo->root_window == f->output_data.x->parent_desc) + { + /* Try _NET_FRAME_EXTENTS if our parent is the root window. */ + rc = XGetWindowProperty (dpy, win, dpyinfo->Xatom_net_frame_extents, + 0, max_len, False, target_type, + &actual_type, &actual_format, &actual_size, + &bytes_remaining, &tmp_data); + + if (rc == Success && actual_type == target_type && !x_had_errors_p (dpy) + && actual_size == 4 && actual_format == 32) + { + int ign; + Window rootw; + long *fe = (long *)tmp_data; + + XGetGeometry (FRAME_X_DISPLAY (f), win, + &rootw, &real_x, &real_y, &ign, &ign, &ign, &ign); + outer_x = -fe[0]; + outer_y = -fe[2]; + real_x -= fe[0]; + real_y -= fe[2]; + } + } + + if (tmp_data) XFree (tmp_data); + x_uncatch_errors (); 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) = XInternAtom (dpyinfo->display, "_NET_WM_ICON_NAME", False); dpyinfo->Xatom_net_wm_name = XInternAtom (dpyinfo->display, "_NET_WM_NAME", False); + dpyinfo->Xatom_net_frame_extents + = XInternAtom (dpyinfo->display, "_NET_FRAME_EXTENTS", False); dpyinfo->x_dnd_atoms_size = 8; 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 Window net_supported_window; Atom Xatom_net_window_type, Xatom_net_window_type_tooltip; - /* Atoms dealing with maximization and fullscreen */ + /* Atoms dealing with EWMH (i.e. _NET_...) */ Atom Xatom_net_wm_state, Xatom_net_wm_state_fullscreen_atom, Xatom_net_wm_state_maximized_horz, Xatom_net_wm_state_maximized_vert, - Xatom_net_wm_state_sticky; + Xatom_net_wm_state_sticky, Xatom_net_frame_extents; /* XSettings atoms and windows. */ Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr; |