static BOOL ns_do_open_file = NO;
static BOOL ns_last_use_native_fullscreen;
+/* Non-zero means that a HELP_EVENT has been generated since Emacs
+ start. */
+
+static BOOL any_help_event_p = NO;
+
static struct {
struct input_event *q;
int nr, cap;
{
if (self = [super init])
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
+#ifdef NS_IMPL_COCOA
self->isFirst = YES;
#endif
#ifdef NS_IMPL_GNUSTEP
return self;
}
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
+#ifdef NS_IMPL_COCOA
- (void)run
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+#ifndef NSAppKitVersionNumber10_8
+#define NSAppKitVersionNumber10_8 1187
+#endif
+
+ if (NSAppKitVersionNumber <= NSAppKitVersionNumber10_8)
+ {
+ [super run];
+ return;
+ }
- if (isFirst) [self finishLaunching];
- isFirst = NO;
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- shouldKeepRunning = YES;
- do
- {
- [pool release];
- pool = [[NSAutoreleasePool alloc] init];
-
- NSEvent *event =
- [self nextEventMatchingMask:NSAnyEventMask
- untilDate:[NSDate distantFuture]
- inMode:NSDefaultRunLoopMode
- dequeue:YES];
- [self sendEvent:event];
- [self updateWindows];
- } while (shouldKeepRunning);
+ if (isFirst) [self finishLaunching];
+ isFirst = NO;
+
+ shouldKeepRunning = YES;
+ do
+ {
+ [pool release];
+ pool = [[NSAutoreleasePool alloc] init];
- [pool release];
+ NSEvent *event =
+ [self nextEventMatchingMask:NSAnyEventMask
+ untilDate:[NSDate distantFuture]
+ inMode:NSDefaultRunLoopMode
+ dequeue:YES];
+ [self sendEvent:event];
+ [self updateWindows];
+ } while (shouldKeepRunning);
+
+ [pool release];
}
- (void)stop: (id)sender
// The file dialog still leaks 7k - 10k on 10.9 though.
[super stop:sender];
}
-#endif
+#endif /* NS_IMPL_COCOA */
- (void)logNotification: (NSNotification *)notification
{
if (EQ (font->driver->type, Qns))
nsfont = ((struct nsfont_info *)font)->nsfont;
+#ifdef NS_IMPL_COCOA
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
else
nsfont = (NSFont *) macfont_get_nsctfont (font);
+#endif
#endif
if ((newFont = [sender convertFont: nsfont]))
/* NOTE: help_echo_{window,pos,object} are set in xdisp.c
(note_mouse_highlight), which is called through the
note_mouse_movement () call above */
+ any_help_event_p = YES;
gen_help_event (help_echo_string, frame, help_echo_window,
help_echo_object, help_echo_pos);
}
- else
- {
- help_echo_string = Qnil;
- gen_help_event (Qnil, frame, Qnil, Qnil, 0);
- }
if (emacsframe->mouse_moved && send_appdefined)
ns_send_appdefined (-1);
x_set_frame_alpha (emacsframe);
}
+ if (any_help_event_p)
+ {
+ Lisp_Object frame;
+ XSETFRAME (frame, emacsframe);
+ help_echo_string = Qnil;
+ gen_help_event (Qnil, frame, Qnil, Qnil, 0);
+ }
+
if (emacs_event && is_focus_frame)
{
[self deleteWorkingText];
}
-- (void)dealloc
-{
- NSTRACE (EmacsScroller_dealloc);
- if (!NILP (win))
- wset_vertical_scroll_bar (XWINDOW (win), Qnil);
- [super dealloc];
-}
-
-
- condemn
{
NSTRACE (condemn);
view = (EmacsView *)FRAME_NS_VIEW (frame);
if (view != nil)
view->scrollbarsNeedingUpdate++;
+ if (!NILP (win))
+ wset_vertical_scroll_bar (XWINDOW (win), Qnil);
+ win = Qnil;
[self removeFromSuperview];
[self release];
unblock_input ();