mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-28 00:01:33 -08:00
(x_real_positions): Handle failure in XQueryTree.
This commit is contained in:
parent
7c3f9166ee
commit
e7161ad9ff
1 changed files with 9 additions and 3 deletions
12
src/xfns.c
12
src/xfns.c
|
|
@ -1176,13 +1176,19 @@ x_real_positions (f, xptr, yptr)
|
|||
Window wm_window, rootw;
|
||||
Window *tmp_children;
|
||||
unsigned int tmp_nchildren;
|
||||
int success;
|
||||
|
||||
XQueryTree (FRAME_X_DISPLAY (f), win, &rootw,
|
||||
&wm_window, &tmp_children, &tmp_nchildren);
|
||||
XFree ((char *) tmp_children);
|
||||
success = XQueryTree (FRAME_X_DISPLAY (f), win, &rootw,
|
||||
&wm_window, &tmp_children, &tmp_nchildren);
|
||||
|
||||
had_errors = x_had_errors_p (FRAME_X_DISPLAY (f));
|
||||
|
||||
/* Don't free tmp_children if XQueryTree failed. */
|
||||
if (! success)
|
||||
break;
|
||||
|
||||
XFree ((char *) tmp_children);
|
||||
|
||||
if (wm_window == rootw || had_errors)
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue