[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-30 11e7ae3964e: Fix bug#72254
From: |
Po Lu |
Subject: |
emacs-30 11e7ae3964e: Fix bug#72254 |
Date: |
Wed, 11 Sep 2024 20:23:25 -0400 (EDT) |
branch: emacs-30
commit 11e7ae3964e192b0e4bcc437a04278ee727e720b
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix bug#72254
* src/pgtkselect.c (Fpgtk_get_selection_internal): If requesting
TARGETS with just one result, return it as a vector.
(bug#72254)
---
src/pgtkselect.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/pgtkselect.c b/src/pgtkselect.c
index 271411b87ca..9e172c58602 100644
--- a/src/pgtkselect.c
+++ b/src/pgtkselect.c
@@ -1644,10 +1644,24 @@ frame's display, or the first available X display. */)
if (NILP (val) && FRAME_LIVE_P (f))
{
- Lisp_Object frame;
+ Lisp_Object frame, val;
XSETFRAME (frame, f);
- return pgtk_get_foreign_selection (selection_symbol, target_type,
- time_stamp, frame);
+
+ val = pgtk_get_foreign_selection (selection_symbol, target_type,
+ time_stamp, frame);
+
+ /* A window property holding just one item is indistinguishable
+ from an array of one element, and is always decoded as the
+ former, producing issues with programs that expect the TARGETS
+ property always to return vectors, even when the toolkit
+ reports just one data type. Though X sidesteps this ambiguity
+ by defining TARGETS as returning at least two properties
+ TARGETS and MULTIPLE, GTK knows no such scruples, and therefore
+ symbol values (or nil) should be enclosed in vectors when
+ TARGETS is being requested. (bug#72254) */
+ if (EQ (target_type, QTARGETS) && (NILP (val) || SYMBOLP (val)))
+ val = make_vector (NILP (val) ? 0 : 1, val);
+ return val;
}
if (CONSP (val) && SYMBOLP (XCAR (val)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-30 11e7ae3964e: Fix bug#72254,
Po Lu <=