SHA256
1
0
forked from pool/emacs
emacs/emacs-24.3-xevent.patch

45 lines
1.7 KiB
Diff
Raw Normal View History

--- src/xmenu.c
+++ src/xmenu.c 2013-05-21 15:42:44.917439139 +0000
@@ -953,7 +953,7 @@ set_frame_menubar (FRAME_PTR f, bool fir
{
deep_p = 1;
f->output_data.x->saved_menu_event = xmalloc (sizeof (XEvent));
- f->output_data.x->saved_menu_event->type = 0;
+ memset(f->output_data.x->saved_menu_event,0,sizeof(XEvent));
}
#ifdef USE_GTK
--- src/xselect.c
+++ src/xselect.c 2012-07-03 11:08:10.732010284 +0000
@@ -2350,7 +2350,14 @@ x_fill_property_data (Display *dpy, Lisp
Lisp_Object o = XCAR (iter);
if (INTEGERP (o) || FLOATP (o) || CONSP (o))
- val = cons_to_signed (o, LONG_MIN, LONG_MAX);
+ {
+ if (INTEGERP (o) && (XFASTINT (o) > LONG_MAX || XFASTINT (o) < LONG_MIN))
+ val = (long) XFASTINT (o);
+ else if (FLOATP (o) && (XFLOAT_DATA (o) > LONG_MAX || XFLOAT_DATA (o) < LONG_MIN))
+ val = (long) XFLOAT_DATA (o);
+ else
+ val = cons_to_signed (o, LONG_MIN, LONG_MAX);
+ }
else if (STRINGP (o))
{
block_input ();
--- src/xterm.c
+++ src/xterm.c 2013-05-21 15:44:18.617938988 +0000
@@ -5764,9 +5764,11 @@ static struct x_display_info *next_noop_
#define SET_SAVED_BUTTON_EVENT \
do \
{ \
- if (f->output_data.x->saved_menu_event == 0) \
+ if (f->output_data.x->saved_menu_event == 0) { \
f->output_data.x->saved_menu_event = \
xmalloc (sizeof (XEvent)); \
+ memset(f->output_data.x->saved_menu_event,0,sizeof(XEvent)); \
+ } \
*f->output_data.x->saved_menu_event = event; \
inev.ie.kind = MENU_BAR_ACTIVATE_EVENT; \
XSETFRAME (inev.ie.frame_or_window, f); \