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

44 lines
1.7 KiB
Diff
Raw Normal View History

--- src/xmenu.c
+++ src/xmenu.c 2012-07-03 11:51:37.448009822 +0000
@@ -964,7 +964,7 @@ set_frame_menubar (FRAME_PTR f, int firs
{
deep_p = 1;
f->output_data.x->saved_menu_event = (XEvent*)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
@@ -2344,7 +2344,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 2012-07-03 11:47:12.060510503 +0000
@@ -5753,9 +5753,10 @@ 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 \
= (XEvent *) 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); \