diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 12 | ||||
| -rw-r--r-- | src/keyboard.c | 26 | ||||
| -rw-r--r-- | src/termhooks.h | 12 | ||||
| -rw-r--r-- | src/xterm.c | 2 |
4 files changed, 24 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e762eb13b87..bcbc455dba6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | Remove pad from struct input_event. | ||
| 4 | * termhooks.h (struct input_event): Remove padding field. | ||
| 5 | Adjust comment. | ||
| 6 | * keyboard.c (event_to_kboard): Simplify because frame_or_window | ||
| 7 | member is never cons for a long time. Adjust comment. | ||
| 8 | (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and | ||
| 9 | SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment. | ||
| 10 | * xterm.c (handle_one_xevent): Do not initialize frame_or_window | ||
| 11 | field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT. | ||
| 12 | |||
| 1 | 2012-11-01 Eli Zaretskii <eliz@gnu.org> | 13 | 2012-11-01 Eli Zaretskii <eliz@gnu.org> |
| 2 | 14 | ||
| 3 | * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776) | 15 | * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776) |
diff --git a/src/keyboard.c b/src/keyboard.c index ab20ef71660..dfd4d0c2648 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -3416,20 +3416,13 @@ int stop_character EXTERNALLY_VISIBLE; | |||
| 3416 | static KBOARD * | 3416 | static KBOARD * |
| 3417 | event_to_kboard (struct input_event *event) | 3417 | event_to_kboard (struct input_event *event) |
| 3418 | { | 3418 | { |
| 3419 | Lisp_Object frame; | 3419 | Lisp_Object obj = event->frame_or_window; |
| 3420 | frame = event->frame_or_window; | 3420 | /* There are some events that set this field to nil or string. */ |
| 3421 | if (CONSP (frame)) | 3421 | if (WINDOWP (obj)) |
| 3422 | frame = XCAR (frame); | 3422 | obj = WINDOW_FRAME (XWINDOW (obj)); |
| 3423 | else if (WINDOWP (frame)) | 3423 | /* Also ignore dead frames here. */ |
| 3424 | frame = WINDOW_FRAME (XWINDOW (frame)); | 3424 | return ((FRAMEP (obj) && FRAME_LIVE_P (XFRAME (obj))) |
| 3425 | 3425 | ? FRAME_KBOARD (XFRAME (obj)) : NULL); | |
| 3426 | /* There are still some events that don't set this field. | ||
| 3427 | For now, just ignore the problem. | ||
| 3428 | Also ignore dead frames here. */ | ||
| 3429 | if (!FRAMEP (frame) || !FRAME_LIVE_P (XFRAME (frame))) | ||
| 3430 | return 0; | ||
| 3431 | else | ||
| 3432 | return FRAME_KBOARD (XFRAME (frame)); | ||
| 3433 | } | 3426 | } |
| 3434 | 3427 | ||
| 3435 | #ifdef subprocesses | 3428 | #ifdef subprocesses |
| @@ -12173,14 +12166,15 @@ mark_kboards (void) | |||
| 12173 | { | 12166 | { |
| 12174 | if (event == kbd_buffer + KBD_BUFFER_SIZE) | 12167 | if (event == kbd_buffer + KBD_BUFFER_SIZE) |
| 12175 | event = kbd_buffer; | 12168 | event = kbd_buffer; |
| 12169 | /* These two special event types has no Lisp_Objects to mark. */ | ||
| 12176 | if (event->kind != SELECTION_REQUEST_EVENT | 12170 | if (event->kind != SELECTION_REQUEST_EVENT |
| 12177 | && event->kind != SELECTION_CLEAR_EVENT) | 12171 | && event->kind != SELECTION_CLEAR_EVENT) |
| 12178 | { | 12172 | { |
| 12179 | mark_object (event->x); | 12173 | mark_object (event->x); |
| 12180 | mark_object (event->y); | 12174 | mark_object (event->y); |
| 12175 | mark_object (event->frame_or_window); | ||
| 12176 | mark_object (event->arg); | ||
| 12181 | } | 12177 | } |
| 12182 | mark_object (event->frame_or_window); | ||
| 12183 | mark_object (event->arg); | ||
| 12184 | } | 12178 | } |
| 12185 | } | 12179 | } |
| 12186 | } | 12180 | } |
diff --git a/src/termhooks.h b/src/termhooks.h index c33c2dd1587..2d97fcdbc1e 100644 --- a/src/termhooks.h +++ b/src/termhooks.h | |||
| @@ -242,16 +242,8 @@ struct input_event | |||
| 242 | Lisp_Object x, y; | 242 | Lisp_Object x, y; |
| 243 | Time timestamp; | 243 | Time timestamp; |
| 244 | 244 | ||
| 245 | /* This is padding just to put the frame_or_window field | 245 | /* This field is copied into a vector while the event is in |
| 246 | past the size of struct selection_input_event. */ | 246 | the queue, so that garbage collections won't kill it. */ |
| 247 | int *padding[2]; | ||
| 248 | |||
| 249 | /* This field is copied into a vector while the event is in the queue, | ||
| 250 | so that garbage collections won't kill it. */ | ||
| 251 | /* In a menu_bar_event, this is a cons cell whose car is the frame | ||
| 252 | and whose cdr is the Lisp object that is the event's value. */ | ||
| 253 | /* This field is last so that struct selection_input_event | ||
| 254 | does not overlap with it. */ | ||
| 255 | Lisp_Object frame_or_window; | 247 | Lisp_Object frame_or_window; |
| 256 | 248 | ||
| 257 | /* Additional event argument. This is used for TOOL_BAR_EVENTs and | 249 | /* Additional event argument. This is used for TOOL_BAR_EVENTs and |
diff --git a/src/xterm.c b/src/xterm.c index f8420d13a32..4dd1dee0f75 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -6108,7 +6108,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6108 | SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display; | 6108 | SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display; |
| 6109 | SELECTION_EVENT_SELECTION (&inev.sie) = eventp->selection; | 6109 | SELECTION_EVENT_SELECTION (&inev.sie) = eventp->selection; |
| 6110 | SELECTION_EVENT_TIME (&inev.sie) = eventp->time; | 6110 | SELECTION_EVENT_TIME (&inev.sie) = eventp->time; |
| 6111 | inev.ie.frame_or_window = Qnil; | ||
| 6112 | } | 6111 | } |
| 6113 | break; | 6112 | break; |
| 6114 | 6113 | ||
| @@ -6128,7 +6127,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6128 | SELECTION_EVENT_TARGET (&inev.sie) = eventp->target; | 6127 | SELECTION_EVENT_TARGET (&inev.sie) = eventp->target; |
| 6129 | SELECTION_EVENT_PROPERTY (&inev.sie) = eventp->property; | 6128 | SELECTION_EVENT_PROPERTY (&inev.sie) = eventp->property; |
| 6130 | SELECTION_EVENT_TIME (&inev.sie) = eventp->time; | 6129 | SELECTION_EVENT_TIME (&inev.sie) = eventp->time; |
| 6131 | inev.ie.frame_or_window = Qnil; | ||
| 6132 | } | 6130 | } |
| 6133 | break; | 6131 | break; |
| 6134 | 6132 | ||