Commit 64ccff5f authored by Jan Djärv's avatar Jan Djärv
Browse files

* 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.

Fixes: debbugs:12698
parent e483264c
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.
......
......@@ -190,7 +190,8 @@ Updated by Christian Limpach (chris@nice.ch)
/* 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;
......@@ -3436,8 +3437,7 @@ overwriting cursor (usually when cursor on a tab) */
-------------------------------------------------------------------------- */
{
int result;
NSEvent *ev;
int k, nr = 0;
int t, k, nr = 0;
struct input_event event;
char c;
......@@ -3521,16 +3521,11 @@ overwriting cursor (usually when cursor on a tab) */
}
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)
{
......@@ -4307,7 +4302,7 @@ - (void)sendEvent: (NSEvent *)theEvent
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment