summaryrefslogtreecommitdiff
path: root/src/xselect.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-05-28 09:37:29 +0800
committerPo Lu <luangruo@yahoo.com>2022-05-28 09:37:29 +0800
commitac13957b86ad699a76a0b248063551f971c4cef9 (patch)
treec8c92ca5f92802e7807d7aaa58ea112b836e39cc /src/xselect.c
parentb2c8e8a299dadce7dc1bae2adf73ee9303856bb6 (diff)
downloademacs-ac13957b86ad699a76a0b248063551f971c4cef9.tar.gz
Fix frame destruction issues and misuse of x_get_atom_name
* src/frame.c (delete_frame): Prevent deleting the dnd frame while waiting for finish as well. * src/xselect.c (Fx_get_atom_name): Clean up code and fix uninitialized use of need_sync. * src/xterm.c (x_dnd_send_unsupported_drop, x_dnd_send_drop) (handle_one_xevent): Clean up usage of x_get_atom_name. (x_get_atom_name): Accept NULL for need_sync. * src/xterm.h: Update declarations.
Diffstat (limited to 'src/xselect.c')
-rw-r--r--src/xselect.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/xselect.c b/src/xselect.c
index 3f35842daa0..bfd081b1e28 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2458,24 +2458,25 @@ If the value is 0 or the atom is not known, return the empty string. */)
struct x_display_info *dpyinfo;
Atom atom;
bool had_errors_p, need_sync;
+ char *name;
+ Lisp_Object ret;
dpyinfo = FRAME_DISPLAY_INFO (f);
-
CONS_TO_INTEGER (value, Atom, atom);
- block_input ();
x_catch_errors (dpy);
- char *name = atom ? x_get_atom_name (dpyinfo, atom, &need_sync) : NULL;
+ name = x_get_atom_name (dpyinfo, atom, &need_sync);
had_errors_p = need_sync && x_had_errors_p (dpy);
x_uncatch_errors_after_check ();
- Lisp_Object ret = empty_unibyte_string;
+
+ ret = empty_unibyte_string;
+
if (name)
{
if (!had_errors_p)
ret = build_string (name);
xfree (name);
}
- unblock_input ();
return ret;
}