NSF13FunctionKey, 0xCA,
NSF14FunctionKey, 0xCB,
NSF15FunctionKey, 0xCC,
+ NSF16FunctionKey, 0xCD,
+ NSF17FunctionKey, 0xCE,
+ NSF18FunctionKey, 0xCF,
+ NSF19FunctionKey, 0xD0,
+ NSF20FunctionKey, 0xD1,
+ NSF21FunctionKey, 0xD2,
+ NSF22FunctionKey, 0xD3,
+ NSF23FunctionKey, 0xD4,
+ NSF24FunctionKey, 0xD5,
NSBackspaceCharacter, 0x08, /* 8: Not on some KBs. */
NSDeleteCharacter, 0xFF, /* 127: Big 'delete' key upper right. */
Lisp_Object ns_use_qd_smoothing;
/* Used to pick up AppleHighlightColor on OS X */
-Lisp_Object ns_use_system_highlight_color;
NSString *ns_selection_color;
/* Confirm on exit. */
resourcePath = [resourceDir stringByAppendingPathComponent: @"info"];
if ([fileManager fileExistsAtPath: resourcePath isDirectory: &isDir])
if (isDir)
- setenv ("INFOPATH", [resourcePath UTF8String], 1);
+ setenv ("INFOPATH", [[resourcePath stringByAppendingString: @":"]
+ UTF8String], 1);
+ /* Note, extra colon needed to cause merge w/later user additions. */
}
}
NSView *view = FRAME_NS_VIEW (f);
check_ns ();
BLOCK_INPUT;
- [[view window] makeKeyAndOrderFront: NSApp];
+ FRAME_SAMPLE_VISIBILITY (f);
+ if (FRAME_VISIBLE_P (f))
+ {
+ [[view window] makeKeyAndOrderFront: NSApp];
+ }
UNBLOCK_INPUT;
}
called this (frame.c:Fraise_frame ()) also called raise_lower;
if this ends up the case again, comment this out again. */
if (!FRAME_VISIBLE_P (f))
- ns_raise_frame (f);
+ {
+ f->async_visible = 1;
+ ns_raise_frame (f);
+ }
}
pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
/* If we have a toolbar, take its height into account. */
- /* XXX: GNUstep has not yet implemented the first method below, added
- in Panther, however the second is incorrect under Cocoa. */
if (tb)
FRAME_NS_TOOLBAR_HEIGHT (f) =
+ /* XXX: GNUstep has not yet implemented the first method below, added
+ in Panther, however the second is incorrect under Cocoa. */
#ifdef NS_IMPL_COCOA
NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)])
/* NOTE: previously this would generate wrong result if toolbar not
y < last_mouse_glyph.origin.y ||
y >= (last_mouse_glyph.origin.y + last_mouse_glyph.size.height))
{
+ ns_update_begin(frame);
frame->mouse_moved = 1;
note_mouse_highlight (frame, x, y);
remember_mouse_glyph (frame, x, y, &last_mouse_glyph);
+ ns_update_end(frame);
return 1;
}
/*&& dpyinfo->mouse_face_mouse_frame*/)
{
BLOCK_INPUT;
+ ns_update_begin(f);
if (dpyinfo->mouse_face_mouse_frame)
note_mouse_highlight (dpyinfo->mouse_face_mouse_frame,
dpyinfo->mouse_face_mouse_x,
dpyinfo->mouse_face_mouse_y);
dpyinfo->mouse_face_deferred_gc = 0;
+ ns_update_end(f);
UNBLOCK_INPUT;
}
}
int fx, fy, h;
struct frame *f = WINDOW_XFRAME (w);
struct glyph *phys_cursor_glyph;
- int overspill, cursorToDraw;
+ int overspill;
NSTRACE (dumpcursor);
//fprintf(stderr, "drawcursor (%d,%d) activep = %d\tonp = %d\tc_type = %d\twidth = %d\n",x,y, active_p,on_p,cursor_type,cursor_width);
NSDisableScreenUpdates ();
#endif
- cursorToDraw = active_p ? cursor_type : HOLLOW_BOX_CURSOR;
- switch (cursorToDraw)
+ switch (cursor_type)
{
case NO_CURSOR:
break;
case HBAR_CURSOR:
s = r;
s.origin.y += lrint (0.75 * s.size.height);
- s.size.width = min (FRAME_COLUMN_WIDTH (f), s.size.width);
s.size.height = lrint (s.size.height * 0.25);
NSRectFill (s);
break;
ns_unfocus (f);
/* draw the character under the cursor */
- if (cursorToDraw != NO_CURSOR)
+ if (cursor_type != NO_CURSOR)
draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR);
#ifdef NS_IMPL_COCOA
int th;
char raised_p;
NSRect br;
+ struct face *face;
NSTRACE (ns_dumpglyphs_image);
/* Draw BG: if we need larger area than image itself cleared, do that,
otherwise, since we composite the image under NS (instead of mucking
with its background color), we must clear just the image area. */
- [ns_lookup_indexed_color (NS_FACE_BACKGROUND
- (FACE_FROM_ID (s->f, s->first_glyph->face_id)), s->f) set];
+ if (s->hl == DRAW_MOUSE_FACE)
+ {
+ face = FACE_FROM_ID
+ (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
+ if (!face)
+ face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
+ }
+ else
+ face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
+
+ [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set];
if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin
|| s->img->mask || s->img->pixmap == 0 || s->width != s->background_width)
{
NSRect r[2];
int n, i;
+ struct face *face;
if (!s->background_filled_p)
{
}
ns_focus (s->f, r, n);
- [ns_lookup_indexed_color (NS_FACE_BACKGROUND
- (FACE_FROM_ID (s->f, s->first_glyph->face_id)), s->f) set];
+
+ if (s->hl == DRAW_MOUSE_FACE)
+ {
+ face = FACE_FROM_ID
+ (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
+ if (!face)
+ face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
+ }
+ else
+ face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
+
+ [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set];
+
NSRectFill (r[0]);
NSRectFill (r[1]);
ns_unfocus (s->f);
if (s->for_overlaps || (s->cmp_from > 0
&& ! s->first_glyph->u.cmp.automatic))
s->background_filled_p = 1;
- else /* 1 */
+ else
ns_maybe_dumpglyphs_background
(s, s->first_glyph->type == COMPOSITE_GLYPH);
{
struct input_event ev;
int nevents;
- static NSDate *lastCheck = nil;
/* NSTRACE (ns_read_socket); */
ns_antialias_text = Qt;
ns_antialias_threshold = 10.0; /* not exposed to lisp side */
ns_use_qd_smoothing = Qnil;
- ns_use_system_highlight_color = Qt;
ns_confirm_quit = Qnil;
}
if (!emacs_event)
return;
- if (![[self window] isKeyWindow])
+ if (![[self window] isKeyWindow]
+ && [[theEvent window] isKindOfClass: [EmacsWindow class]])
{
/* XXX: There is an occasional condition in which, when Emacs display
updates a different frame from the current one, and temporarily
(dispnew.c:3878), OS will send the event to the correct NSWindow, but
for some reason that window has its first responder set to the NSView
most recently updated (I guess), which is not the correct one. */
- if ([[theEvent window] isKindOfClass: [EmacsWindow class]])
- [(EmacsView *)[[theEvent window] delegate] keyDown: theEvent];
+ [(EmacsView *)[[theEvent window] delegate] keyDown: theEvent];
return;
}
}
#endif /* NS_IMPL_COCOA */
+ // Calling x_set_window_size tends to get us into inf-loops
+ // (x_set_window_size causes a resize which causes
+ // a "windowDidResize" which calls x_set_window_size).
+ // At least with GNUStep, don't know about MacOSX. --Stef
+#ifndef NS_IMPL_GNUSTEP
if (cols > 0 && rows > 0)
- x_set_window_size (emacsframe, 0, cols, rows);
+ x_set_window_size (emacsframe, 0, cols, rows);
+#endif
ns_send_appdefined (-1);
}
ns_clear_frame_area (emacsframe, x, y, width, height);
expose_frame (emacsframe, x, y, width, height);
- emacsframe->async_visible = 1;
- emacsframe->async_iconified = 0;
+
+ /*
+ drawRect: may be called (at least in OS X 10.5) for invisible
+ views as well for some reason. Thus, do not infer visibility
+ here.
+
+ emacsframe->async_visible = 1;
+ emacsframe->async_iconified = 0;
+ */
}
DEFVAR_LISP ("ns-use-qd-smoothing", &ns_use_qd_smoothing,
"Whether to render text using QuickDraw (less heavy) antialiasing. Only has an effect on OS X Panther and above. Default is nil (use Quartz smoothing).");
- DEFVAR_LISP ("ns-use-system-highlight-color",
- &ns_use_system_highlight_color,
- "Whether to use the system default (on OS X only) for the highlight color. Nil means to use standard emacs (prior to version 21) 'grey'.");
-
DEFVAR_LISP ("ns-confirm-quit", &ns_confirm_quit,
"Whether to confirm application quit using dialog.");