diff options
| author | Jan Djärv | 2013-08-07 18:59:23 +0200 |
|---|---|---|
| committer | Jan Djärv | 2013-08-07 18:59:23 +0200 |
| commit | 8fd9c92e1fc88dc04f3bb2c9a370982e980b941e (patch) | |
| tree | cdf27ecf9b89295a2f776427a98609122a87227e /src/xselect.c | |
| parent | cdc1ebb9413fb4db15aa5a3175bcb6db3ce02609 (diff) | |
| download | emacs-8fd9c92e1fc88dc04f3bb2c9a370982e980b941e.tar.gz emacs-8fd9c92e1fc88dc04f3bb2c9a370982e980b941e.zip | |
* xselect.c (x_send_client_event): Set send_event and serial, memset
data.l as it might be bigger than data.b. Use 24 bit mask to
XSendEvent.
Fixes: debbugs:15034
Diffstat (limited to 'src/xselect.c')
| -rw-r--r-- | src/xselect.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/xselect.c b/src/xselect.c index 3a16d7d3496..e5f2e214fba 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -2628,6 +2628,8 @@ x_send_client_event (Lisp_Object display, Lisp_Object dest, Lisp_Object from, | |||
| 2628 | 2628 | ||
| 2629 | block_input (); | 2629 | block_input (); |
| 2630 | 2630 | ||
| 2631 | event.xclient.send_event = True; | ||
| 2632 | event.xclient.serial = 0; | ||
| 2631 | event.xclient.message_type = message_type; | 2633 | event.xclient.message_type = message_type; |
| 2632 | event.xclient.display = dpyinfo->display; | 2634 | event.xclient.display = dpyinfo->display; |
| 2633 | 2635 | ||
| @@ -2635,19 +2637,19 @@ x_send_client_event (Lisp_Object display, Lisp_Object dest, Lisp_Object from, | |||
| 2635 | when sending to the root window. */ | 2637 | when sending to the root window. */ |
| 2636 | event.xclient.window = to_root ? FRAME_OUTER_WINDOW (f) : wdest; | 2638 | event.xclient.window = to_root ? FRAME_OUTER_WINDOW (f) : wdest; |
| 2637 | 2639 | ||
| 2638 | 2640 | memset (event.xclient.data.l, 0, sizeof (event.xclient.data.l)); | |
| 2639 | memset (event.xclient.data.b, 0, sizeof (event.xclient.data.b)); | ||
| 2640 | x_fill_property_data (dpyinfo->display, values, event.xclient.data.b, | 2641 | x_fill_property_data (dpyinfo->display, values, event.xclient.data.b, |
| 2641 | event.xclient.format); | 2642 | event.xclient.format); |
| 2642 | 2643 | ||
| 2643 | /* If event mask is 0 the event is sent to the client that created | 2644 | /* If event mask is 0 the event is sent to the client that created |
| 2644 | the destination window. But if we are sending to the root window, | 2645 | the destination window. But if we are sending to the root window, |
| 2645 | there is no such client. Then we set the event mask to 0xffff. The | 2646 | there is no such client. Then we set the event mask to 0xffffff. The |
| 2646 | event then goes to clients selecting for events on the root window. */ | 2647 | event then goes to clients selecting for events on the root window. */ |
| 2647 | x_catch_errors (dpyinfo->display); | 2648 | x_catch_errors (dpyinfo->display); |
| 2648 | { | 2649 | { |
| 2649 | int propagate = to_root ? False : True; | 2650 | int propagate = to_root ? False : True; |
| 2650 | unsigned mask = to_root ? 0xffff : 0; | 2651 | long mask = to_root ? 0xffffff : 0; |
| 2652 | |||
| 2651 | XSendEvent (dpyinfo->display, wdest, propagate, mask, &event); | 2653 | XSendEvent (dpyinfo->display, wdest, propagate, mask, &event); |
| 2652 | XFlush (dpyinfo->display); | 2654 | XFlush (dpyinfo->display); |
| 2653 | } | 2655 | } |