+2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsterm.m (NO_APPDEFINED_DATA): New define.
+ (last_appdefined_event_data): New variable
+ (last_appdefined_event): Remove.
+ (ns_select): Initialize t from last_appdefined_event_data instead
+ of [last_appdefined_event data1].
+ (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
+ remove last_appdefined_event (Bug#12698).
+
2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
* frame.c (x_set_font): Catch internal error.
/* event loop */
static BOOL send_appdefined = YES;
-static NSEvent *last_appdefined_event = 0;
+#define NO_APPDEFINED_DATA (-8)
+static int last_appdefined_event_data = NO_APPDEFINED_DATA;
static NSTimer *timed_entry = 0;
static NSTimer *scroll_repeat_entry = nil;
static fd_set select_readfds, select_writefds;
-------------------------------------------------------------------------- */
{
int result;
- NSEvent *ev;
- int k, nr = 0;
+ int t, k, nr = 0;
struct input_event event;
char c;
}
unblock_input ();
- ev = last_appdefined_event;
+ t = last_appdefined_event_data;
- if (ev)
+ if (t != NO_APPDEFINED_DATA)
{
- int t;
- if ([ev type] != NSApplicationDefined)
- emacs_abort ();
-
- t = [ev data1];
- last_appdefined_event = 0;
+ last_appdefined_event_data = NO_APPDEFINED_DATA;
if (t == -2)
{
modal loop. Just defer it until later. */
if ([NSApp modalWindow] == nil)
{
- last_appdefined_event = theEvent;
+ last_appdefined_event_data = [theEvent data1];
[self stop: self];
}
else