aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/keyboard.c21
-rw-r--r--src/xterm.h6
3 files changed, 23 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0eb69f59efe..291eec18fe9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * keyboard.c (event_to_kboard): Do not dereference
4 frame_or_window field of SELECTION_REQUEST_EVENT
5 and SELECTION_CLEAR_EVENT events (Bug#12814).
6 * xterm.h (struct selection_input_event): Adjust comment.
7
12012-11-07 Eli Zaretskii <eliz@gnu.org> 82012-11-07 Eli Zaretskii <eliz@gnu.org>
2 9
3 * w32fns.c (modifier_set): Don't report modifiers from toggle key, 10 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
diff --git a/src/keyboard.c b/src/keyboard.c
index dfd4d0c2648..8f3a206139d 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3416,13 +3416,20 @@ int stop_character EXTERNALLY_VISIBLE;
3416static KBOARD * 3416static KBOARD *
3417event_to_kboard (struct input_event *event) 3417event_to_kboard (struct input_event *event)
3418{ 3418{
3419 Lisp_Object obj = event->frame_or_window; 3419 /* Not applicable for these special events. */
3420 /* There are some events that set this field to nil or string. */ 3420 if (event->kind == SELECTION_REQUEST_EVENT
3421 if (WINDOWP (obj)) 3421 || event->kind == SELECTION_CLEAR_EVENT)
3422 obj = WINDOW_FRAME (XWINDOW (obj)); 3422 return NULL;
3423 /* Also ignore dead frames here. */ 3423 else
3424 return ((FRAMEP (obj) && FRAME_LIVE_P (XFRAME (obj))) 3424 {
3425 ? FRAME_KBOARD (XFRAME (obj)) : NULL); 3425 Lisp_Object obj = event->frame_or_window;
3426 /* There are some events that set this field to nil or string. */
3427 if (WINDOWP (obj))
3428 obj = WINDOW_FRAME (XWINDOW (obj));
3429 /* Also ignore dead frames here. */
3430 return ((FRAMEP (obj) && FRAME_LIVE_P (XFRAME (obj)))
3431 ? FRAME_KBOARD (XFRAME (obj)) : NULL);
3432 }
3426} 3433}
3427 3434
3428#ifdef subprocesses 3435#ifdef subprocesses
diff --git a/src/xterm.h b/src/xterm.h
index 4bc8f9813ed..6ef3d11fe48 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -890,10 +890,8 @@ struct scroll_bar
890 by this structure. */ 890 by this structure. */
891 891
892/* For an event of kind SELECTION_REQUEST_EVENT, 892/* For an event of kind SELECTION_REQUEST_EVENT,
893 this structure really describes the contents. 893 this structure really describes the contents. */
894 **Don't make this struct longer!** 894
895 If it overlaps the frame_or_window field of struct input_event,
896 that will cause GC to crash. */
897struct selection_input_event 895struct selection_input_event
898{ 896{
899 int kind; 897 int kind;